In a dos batch file I retrieve the date time with that:
REM --------Retrieving date time
for /f %%x in ('wmic path win32_utctime get /format:list ^| findstr "="') do set %%x
set Month=0%Month%
set Month=%Month:~-2%
set Day=0%Day%
set Day=%Day:~-2%
set Hour=0%Hour%
set Hour=%Hour:~-2%
set Minute=0%Minute%
set Minute=%Minute:~-2%
set Second=0%Second%
set Second=%Second:~-2%
set TimeStamp=%Year%-%Month%-%Day%_%Hour%%Minute%%Second%
echo %TimeStamp%
pause
and with that I get the UTC time but not the one for my time zone (+2)
so 071958 –> 07:19:58 while here it is 09:19:58.
I tried to tweak the code above but nothing worked.
Thanks
>Solution :
Try using win32_localtime in place of win32_utctime
