How to get locale-independent modified time and creation time of a file in batch?
With batch variable/parameter expansion like %~t1 one can get a timestamp of a file. I would like to set the year of the file to another variable would like to support multiple locales. How can you get a file's datetime, independent of locale and regional settings? No powershell please. I'll post few options 1) First one is with wmic (not available for XP home edition) ( LastModified can be changed with CreationDate or LastAccessed ) @echo off set file_loc=.\temp_file for %%# in ("%file_loc%") do set file_loc=%%~dpfnx# set file_loc=%file_loc:\=\\% for /f "delims=." %%t in ('"WMIC DATAFILE