I wrote the following batch in order to get the last modified date. The problem is that it gives it in clock time and not in UTC time. I know I have the lag in minutes but it is not that simple to do the shift of the number with the batch file. Is there a flag to give to wmic to obtain UTC time? This is the batch file
@echo off
setlocal enableextensions disabledelayedexpansion
set file=%1
set WORKINGdir=%~dp0
rem wmic wants double backslash
set PATHfile=%WORKINGdir%%file%
set PATHfile=%PATHfile:\=\\%
for /f %%a in (
'wmic DataFile where "Name='%PATHfile%'" get lastmodified ^| find "+" '
) do set "val=%%a"
echo %val%
rem get first 14 digits (good until year 9999)
echo %val:~0,14%
endlocal
This gives me this output:
20161026144823.620815+120
20161026144823
Best Answer
it is possible with pure batch albeit it might be to slow for a large number of files. The batch routines are derived from functions out of Richie Lawrence Batch Function Library.
Gives this Output
HTH