[Solved]jdate doesn't work with custom regional settings????
Posted: 27 Mar 2009 15:16
I'm not going to pretend to completely understand julian . . .
The code doesn't seem to differentiate between 4 digit year and 2 digit year format. On my machine with a 4 digit year, :jdate %date% returns 2454918 where %date% is "Fri 03/27/2009". On my custom computer with a 2 digit year, :jdate %date% returns 1724433 where %date% is "03/27/09".
Perhaps this is accounted for by the specs -- which state a 4 digit year -- but then it proceeds to use the system variable %date% if nothing else is given (plus it claims to match regional settings--which it does other than the 2 digit/4 digit date (I think)).
I guess it would be too complicated perhaps to try and code an intelligent guess. Something like "if I must use %date%, then set yy=2000 + yy %% 2000 before calculating the julian date"?
Or if (and ONLY if) %date% is used, then assume the current date is at least 2000 -- then it would be:
Maybe I'm thinking too much. ?
The code doesn't seem to differentiate between 4 digit year and 2 digit year format. On my machine with a 4 digit year, :jdate %date% returns 2454918 where %date% is "Fri 03/27/2009". On my custom computer with a 2 digit year, :jdate %date% returns 1724433 where %date% is "03/27/09".
Perhaps this is accounted for by the specs -- which state a 4 digit year -- but then it proceeds to use the system variable %date% if nothing else is given (plus it claims to match regional settings--which it does other than the 2 digit/4 digit date (I think)).
I guess it would be too complicated perhaps to try and code an intelligent guess. Something like "if I must use %date%, then set yy=2000 + yy %% 2000 before calculating the julian date"?
Or if (and ONLY if) %date% is used, then assume the current date is at least 2000 -- then it would be:
Code: Select all
set /a "yy=10000%yy% %% 10000 %% 2000 + 2000,mm=100%mm% %% 100,dd=100%dd% %% 100"
Maybe I'm thinking too much. ?