Firstly excellent spot for batch info!
I'm using ftime and jdate in a wee script and it was producing unexpected results:
ftime was always returning todays date
With echo on I was able to step through and see the date passed to jdate from ftime was empty string.
I think I've tracked it down to this line of code
Code: Select all
'"dir %attr% /-c "%file%"|findstr "^^[0-1]""'
(line 31 here http://www.dostips.com/?t=Batch_FileDate)
I think this is looking for the string that starts with 0 or 1, which I'm guessing would be the only digits possible if you have the date in a US style format (month/day/year).
Here in the UK we like it day/month/year
Anyhow I changed this to [0-3] which covers the 'day' range and the code works as expected.
Whether or not the code should be changed on the site I don't know, but maybe a note or something - or even this post will help others with diff regional settings
Thanks again
onion