|
Question : How do I get the time in HH:MM:SS format into a text file?
|
|
We're currently using the TIME /T function to put the time in hours and minutes into a text file.
i.e.
time /t >>c:\timings.txt
The result we get placed in the text file is in the format HH:MM
However, we also need seconds as well, how do you accomplish this?
We're using Windows NT.
|
|
Answer : How do I get the time in HH:MM:SS format into a text file?
|
|
Hi Tommo1975,
Try this: :: -------GETTIME.BAT--------- @ECHO OFF FOR /F "TOKENS=5-7 DELIMS=:. " %%F IN ('echo.^|time^|find "current"') DO ( SET HH=%%F SET MM=%%G SET SS=%%H ) ECHO %HH%:%MM%:%SS% :: -------GETTIME.BAT---------
pb
|
|
|