just tried this will also work FOR /F "tokens=1" %%j IN ('time /t') DO SET thetime=%%j SET hh=%thetime:~0,2% SET mn=%thetime:~3,2% )
----- Original Message ----- From: "John Tolmachoff (Lists)" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, November 04, 2003 1:22 AM Subject: [IMail Forum] OT: command line variable > I have the following to be able to add the date to a file name, however I > need to know how to also add the time. > > FOR /F "tokens=2" %%i IN ('date /t') DO SET thedate=%%i > SET mm=%thedate:~0,2% > SET dd=%thedate:~3,2% > SET yyyy=%thedate:~6,4% > ) > > John Tolmachoff > Engineer/Consultant/Owner > eServices For You > > > > > To Unsubscribe: http://www.ipswitch.com/support/mailing-lists.html > List Archive: http://www.mail-archive.com/imail_forum%40list.ipswitch.com/ > Knowledge Base/FAQ: http://www.ipswitch.com/support/IMail/ > To Unsubscribe: http://www.ipswitch.com/support/mailing-lists.html List Archive: http://www.mail-archive.com/imail_forum%40list.ipswitch.com/ Knowledge Base/FAQ: http://www.ipswitch.com/support/IMail/