gromul
asked on
Batch script: creating a time stamp
I need a small batch script that would create a time stamp based on the current time in this format: YYYYMMDDHHmmSS. Y is for year, M for month, m for minute, etc. Can anyone help me with this? Some sample code to get me started would be helpful.
Thanks!
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!
ASKER
Here's another related one if you're interested:
https://www.experts-exchange.com/questions/21859670/Batch-adding-a-time-stamp-to-file-names.html
https://www.experts-exchange.com/questions/21859670/Batch-adding-a-time-stamp-to-file-names.html
for /F "tokens=2,3,4 delims=/. " %%i in ('date /t') do set d=%%k%%i%%j
for /F "tokens=1,2,3,4 delims=:. " %%i in ('time /t') do set t=%%i%%j%%k%%l
set timestamp=%d%%t%
echo %timestamp%