Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...At last there is indeed a website/forum that deals with professional and serious matters. Keep up with the good work!!"

Geography

Where in the world do Tek-Tips members come from?
newbie345 (Programmer)
17 Apr 03 15:47
I am trying to figure out how to generate a 24hour date time stamp on my backed up file?  I am using WinXP.

code:

rem Start1

for /F "tokens=2,3,4 delims=/ " %%i in ('date/t') do set d=%%k"-"%%i"-"%%j"-"

for /F "tokens=1,2,3 delims=:. " %%i in ('time /T') do set t=%%i%%j%%k

cd \
REM The next line copies the file
copy C:\just C:\bak\d%%t%-just.txt"

REM End1

end code:

This works but the time on it is a 12hour clock and has a or p for am and pm.

Please help!!!
newbie345 (Programmer)
22 Apr 03 15:42
This is a control panel setting.  Regional settings and Select the time tab.
Helpful Member!  pbarrette (Programmer)
12 Jun 03 14:59
Hi Newbie,

Personally, I like parsing "ECHO.|TIME" because it gives seconds and milliseconds if you want them. It will also return 24hour time even if your time settings state 12hr time:

:: ---EXAMPLE.BAT----
@ECHO OFF
FOR /F "TOKENS=5-8 DELIMS=:. " %%F IN ('ECHO.^|TIME') DO (
 SET HR=%%F
 SET MN=%%G
 SET SC=%%H
 SET MS=%%I
)
ECHO Hours=%HR% / Mins=%MN% / Secs=%SC% / Millisec=%MS%
:: ---EXAMPLE.BAT----

pb

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close