Batch, Skriptování

Timestamp for cmd

Simple and useful tool for creating timestamps in command line (batch). It need not fixed time format and is used current time zone.

Examples
for /f "tokens=1" %%a in ('timestamp.exe') do (
  set timestamp=%%a
)
systeminfo > %timestamp%_%computername%.log

for /f "tokens=1-8 delims=- " %%a in ('timestamp.exe -d') do (
  set year=%%a
  set month=%%b
  set day=%%c
  set hour=%%d
  set minute=%%e
  set second=%%f
)
echo Now is %hour%:%minute%:%second% %month%-%day%-%year%

Download: timestamp.zip

2 komentáře

Napsat komentář

*

*povinné položky - email nebude zobrazen