Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- rem -- get time/date parts using w32tm
- rem -- by Vasil "npocmaka" Arnaudov
- echo\
- for /F "eol=C tokens=1,2,3,4,5,6,7 delims=Tabcdefghijklmnopqrstuvwxyz/:. " %%a in ('w32tm /stripchart /computer:localhost /samples:1 /period:1') do (
- if "%%g" neq "" (
- echo year: %%c
- echo month: %%b
- echo day: %%a
- echo\
- echo hour: %%d
- echo am/pm: %%g
- echo minutes: %%e
- echo seconds: %%f
- set "year=%%c"
- set "month=%%b"
- set "day=%%a"
- if "%%g" equ "AM" set "hour=%%d"
- if "%%g" equ "PM" set /a "hour=12+%%d"
- set "miutes=%%e"
- set "seconds=%%f"
- )
- )
- echo\
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement