Powered by GeSHi

Source code for sortdate.vbs

(view source code of sortdate.vbs as plain text)

  1. ' SortDate.vbs,  Version 1.00 for Windows Script Host 2.00
  2. ' Display today's date in YYYYMMDD format
  3. '
  4. ' Written by Rob van der Woude
  5. ' http://www.robvanderwoude.com
  6.  
  7. strSortDate = DatePart("yyyy",Date)
  8. If DatePart("m",Date) < 10 Then
  9. 	strSortDate = strSortDate & "0"
  10. End If
  11. strSortDate = strSortDate & DatePart("m",Date)
  12. If DatePart("d",Date) < 10 Then
  13. 	strSortDate = strSortDate & "0"
  14. End If
  15. strSortDate = strSortDate & DatePart("d",Date)
  16.  
  17. Wscript.Echo("SortDate=" & strSortDate)
  18.