I am writing a batch script (cmd) in which I get the date of the changeset in RFC3339 format:
FOR /F "usebackq delims=" %%G IN ^
(`hg log -r . --cwd "%~dp0" --template "{date|rfc3339date}"`) ^
do SET hg_changeset_date_rfc3339=%%G
echo %hg_changeset_date_rfc3339% <------ writes "2009-08-18T13:00:13+02:00"
Is there a simple and locale-independent way to get the current date in the same format, either with cmd builtins or with an hg command? I would not like to rely on %DATE% because it is locale dependent.
Thanks.
You can use
wmiccommand to get the current Date and time without getting affected by regional settings.Here is the output after executing the script:
Hope it helps 🙂