Posted By

jlvallelonga on 09/18/10


Tagged

get date String today vbscript


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

dekehooper


get today date string


 / Published in: ASP
 

gets you a date string for today in YearMonthDay formant like this 20100917

  1. Function getTodayDateString
  2. dim thisYear, thisMonth, thisDay, dateString
  3.  
  4. thisYear = cstr(year(date))
  5. thisMonth = cstr(month(date))
  6. thisDay = cstr(day(date))
  7.  
  8. If len(thisMonth) = 1 Then
  9. thisMonth = "0" & thisMonth
  10. End If
  11.  
  12. If len(thisDay) = 1 Then
  13. thisDay = "0" & thisDay
  14. End If
  15.  
  16. dateString = thisYear & thisMonth & thisDay
  17. getTodayDateString = dateString
  18. End Function

Report this snippet  

You need to login to post a comment.