singrdk/base/build/timestamp.cmd

24 lines
529 B
Batchfile
Raw Normal View History

2008-11-17 18:29:00 -05:00
@echo off
@rem
@rem This script generates a timestamp suitable for inclusion in a Makefile or
@rem a batch file
@rem
@rem ie for a Makefile:
@rem timestamp.cmd TIMESTAMP > timestamp.inc
@rem and for a batch script:
@rem timestamp.cmd set TIMESTAMP > timestamp.inc
@rem
setlocal
if "%*" == "" (
set OUTFORM=TIMESTAMP
) else (
set OUTFORM=%*
)
FOR /F "TOKENS=1* DELIMS= " %%A IN ('DATE/T') DO SET DATE=%%B
FOR /F "TOKENS=*" %%A IN ('TIME/T') DO SET TIME=%%A
echo %OUTFORM%=%TIME% on %DATE%