Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch    |    Fun with MS-DOS batch files    |    42,547 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 40,550 of 42,547    |
|    Tim Meddick to Fairfax    |
|    Re: Changing date output format to yyyy.    |
|    06 Nov 12 16:31:57    |
      From: timmeddick@o2.co.uk              Forgive me; but I always try to get a handle on the bigger picture :- It       could be as simple as you are setting the date/time format in Regional       Settings, but then, perhaps, you are not refreshing the [cmd.exe] window.       That is; closing all instances of [cmd.exe] and re-opening another *after*       Regional Settings has been dismissed.              When you [re]set the short date:              "Control Panel" > "Regional and Language Options" >              "Regional Options" (Tab) > "Customize" (Button) >              "Date" (Tab) > "Short Date" (Area)              ...if you choose : yyyy-MM-dd       ...(with "Date Seperator" set to : "-" ) the %DATE% variable (in a Command       Prompt window) will look like : 2012-11-06              ...Setting it to : yyyy-MMM-dd       ...and the %DATE% variable will look like : 2012-Nov-06              *NB you do not have to stick to the options in the drop-down box of the       Date Format setting - it also accepts keyboard-typed-input.              You will need to change the "Date Seperator" setting (to; "-"), as other       characters (i.e.; "/") are not helpful when using the %DATE% variable for       naming files.              However, the "Time" format setting in Regional Options has *no* effect on       the format of the %TIME% variable, and will always remain: HH:MM:SS.UU or       16:01:37.66              ==              Cheers, Tim Meddick, Peckham, London. :-)                     P.S. The above settings (short) "Date" and "Time", will *both* always       effect the output of the Command Prompt's "Time" and "Date" commands :              C:\>time /t       04:18pm              C:\>date /t       2012-11-06              ...whereas, it is only the %TIME% variable which is unaffected by any       modified settings.              "Fairfax" |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca