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,899 of 42,547    |
|    corrado.casadei@gmail.com to All    |
|    Re: DOS Time in h:mm:ss vs hh:mm:ss    |
|    29 Jan 14 01:08:49    |
      f865b248       Il giorno mercoledì 16 febbraio 2011 17:51:22 UTC+1, Gary Segal ha scritto:       > Hi,       > I need some help with time format.       > I need to get time in hh:mm:ss format, but my ,bat file gets it in       > h:mm:ss       >        > I already changed control panel (Region and Language) to be hh:mm:ss       > tt still get it in the time in h:mm:ss. I ran it on my other machine       > and get the same results.       >        > Does anyone have an Idea how to take care of it?       > Thanks.       >        > here is my code.       >        > ren Y:\XML\NEO.xml N%time:~0,2%%time:~3,2%%time:~6,3%xml       > ren Y:\XML\LOG.txt L%time:~0,2%%time:~3,2%%time:~6,3%txt       >        > also is there a way to use a variable to use it with Ren and/or Move       > commands.       > for example:       >        > set XName = N%time:~0,2%%time:~3,2%%time:~6,3%xml       > set LName = L%time:~0,2%%time:~3,2%%time:~6,3%txt       >        > ren NEO.xml XName       > move XName Y:\XML\%FolderName%       >        > What is the right syntax       >        > Thank you       > Gary              Set "mytime=%time: =0%"       Set "mytime=%mytime::=%"       Set "mytime=%mytime:~0,6%"              This is the right syntax: this solve my problems.       Thanks to ev'rybody.              CoCa              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca