I am using wmic
to get the time. I have narrowed this down to a one (1) line .bat file. I have learned from stackoverflow about piping stdin and stdout to avoid han
This works, there is no need for the type nul pipe.
wmic os get localdatetime | findstr .
I've never heard of the issue you are reporting.
You could try getTimeStamp.bat - a hybrid JScript/batch utility that provides robust, locale independent, date and time computation and formatting. The utility is pure script using native Windows functionality.
Assuming you have getTimeStamp.bat in your current directory, or better yet, somewhere in your path, then the following will create a variable named currentTimeStamp containing the current date and time in WMIC format.
call getTimeStamp -f {yyyy}{mm}{dd}{hh}{nn}{ss}.{fff}000{zzzz} -r currentTimeStamp
There are a great many formats available, as well as the ability to apply date and time offsets, etc. Full documentation is embedded within the script.