It is possible to get the current date on a Windows system and the last modification date of a file, like thise:
- Current date :
date /T
- Last modification date : ±
echo %~tI%
(where%I
is the file within aFOR
loop)
Both however depend on regional settings, so they need to be replaced by something else:
- Current date :
wmic os get localdatetime
- Last modification date : ???
Does somebody know how to fill in the question marks?
Background information, the idea is to get a result like the following:
- Current date : 20170323115047.782000+060
- Last modification date : 20170323120513.0123
Chop off the first eight characters (in order to get the day)
- Current date : 20170323
- Last modification date : 20170323
This makes it possible to see that the file has indeed been modified today.
I want to avoid regional settings in order to be sure of the amount of characters I need to chop off.