#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2005
    Posts
    65
    Rep Power
    9

    Classic ASP (VB) Converting date range to actual dates?


    What's the best way to convert a range of dates (20131201 to 201401200) to individual dates (20131201, 20131202, 20131203) in a list?

    I can mess with the format of the date and I can calculate the number of days in the range with DateDif but then things get complicated then it rolls over a month or a year. Is there an easy way of doing this or do I have to set a variable based on the number of days per month to build the list to control the roll over to the next month... and what about leap years?

    Any help gratefully received
    Last edited by dwair; December 7th, 2013 at 05:56 AM.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    103
    Rep Power
    9
    datediff in days give you clear number of day between 2 dates, if you need last date of the month it is easy to get too first day of the following month always dateadd("m" ,1,month(now) & "/1/" & year(now)), last date of current month
    dateadd("d", -1 ,dateadd("m" ,1,month(now) & "/1/" & year(now)))

IMN logo majestic logo threadwatch logo seochat tools logo