Riyuzakisan August 12, 2010 at 16:47:44 Specs: Windows Vista
Is it possible for batch to print out the standard time (AM, PM; opposed to military)? Is there such a command or variable? If not, do you know of any other programming language that could print the standard time?
@echo off for /f "tokens=1,2,3 delims=:" %%a in ('echo %time%') do ( set hr=%%a set min=%%b set secs=%%c ) set /a pm=0 if %hr% GTR 12 ( set /a hr=%hr%-12 set /a pm=1 ) cls if %pm%==0 echo Time is %hr%.%min%AM if %pm%==1 echo Time is %hr%.%min%PM pause
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this
site. Computing.Net and Purch hereby disclaim all responsibility
and liability for the content of Computing.Net and its accuracy.