2008-06-16

Convert '%date%' into format 'yyyy-mm-dd'

The format returned by '%date%' is different between Windows 2000 (eg. 'Mon 16/06/2008') and Windows XP (eg. '16/06/2008').

The snippet below works on Windows XP:
%date:~6,4%-%date:~3,2%-%date:~0,2%

but this one works on Windows 2000 too:

%date:~-4,4%-%date:~-7,2%-%date:~-10,2%

No comments:

Post a Comment