ISO 8601 is a great format for date and time (and combined) values.
It allows for both interchange of information, and ease of sorting values.
Recently, I had to create some backup and logging scripts for a 3rd party turn-key installation at a client.
You know: the kind of installation where the 3rd party manages to break their own scripts, but at the mean time close the system so much, that you cannot do anything but standard batch-file scripts.
The system runs partially on a Workstation that is based on a Dutch version of Windows XP, and a server that runs an English version of Windows Server 2008.
Recipe for some twiddling in order to keep the scripts working on both systems, and not to get bitten by localization.
This answer to a StackOverflow question got me a nice head-start: it was said to work in both the English and Portugese versions of Windows.
This post is the process to get correctly function batch-files towards the end of the post.
Of course, we Dutch are persistent enough to have yet different output for the %date% pseudo variable and the date and date /t commands.
The same holds for the %time% pseudo variable and the time and time /t commands.
Read the rest of this entry »