|@tvc, Getting to know the format can be more deceptive than it looks.|
All of the below is based on xp home, I have no other systems to test:
1. Some formats unexpectedly output the day of the week, like "d/MM/yyyy".
2. It's not unlikely to have the month output as a string instead of a number(ie. MMM, feb).
3. The day and month elements become strings if they are repeated more than two times (i.e MMMM). The strings still always seem to have three characters regardless(in english at least). So you can't count on elements being repeated only one, two or three times.
4. 1,2 and 3 may deal with localized strings under different languages. So you may not be able to assume jan=1, feb=2, ect. I haven't tested this personally.
5. It's possible that the format is completely useless(i.e d/d/d, ddd/MM/yy).
6. It's possible for other static text to be present in the output.
7. Ambiguous two digit years may be part of the format.
I know the command above isn't perfect but it seems to me to have the best chance without using an outside utility. There is of course a possibility that writing to the registry is out of the question, causing it to fail outright...
Also the trick *may* work in win2k ported to the version of reg it uses(I believe it's on the cd but not installed by default??). It really depends if the reg buildup changes over windows versions. I think there is a really good chance to work as is on nt 5.2, 6 and 6.1, but who knows....
Quite a while ago I wrote a script to try and parse out the date using the format, with a measure of success....