Administrators occasionally need unambiguous datestamps and timestamps usable
in file and folder names, but how to create
them isn’t immediately obvious. VBScript’s
date-manipulation tools generate dates and
times that are formatted according to locale
and that usually include characters that you
can’t use in filenames.
The ISO 8601 standard is a good
choice for a date- and timestamp format—I’ll explain why and then show you how to
generate ISO 8601 stamps easily, even on
pre–Windows XP systems that don’t provide some convenient stamping tools.
The ISO 8601 Format
If you want to insert a date or time into a log
file, you can use almost any format you
want. However, you have more restrictions
if you want to use a date- or timestamp as
a name or part of a name for a file; the ubiquitous forward slash and colon are both
reserved characters, and removing them
can make a date or time that doesn’t include
leading zeroes ambiguous. . . .
Why become a VIP member?
 |
VIP-only online access |
 |
VIP CD delivered twice a year: offline access to the entire Windows IT Pro article library |
 |
Monthly issue of your choice of Windows IT Pro or SQL Server Magazine |