File: wingetdate.bat

package info (click to toggle)
pgmodeler 0.9.1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 15,192 kB
  • sloc: cpp: 73,887; sh: 687; xml: 61; makefile: 17
file content (7 lines) | stat: -rw-r--r-- 515 bytes parent folder | download
1
2
3
4
5
6
7
@echo off
REM This script is a workaround for lack of a decent 'date' command on Windows.
REM It returns the date in format YYYYMMDD (locale aware) used as build number.
REM Original script available at: http://stackoverflow.com/questions/203090/how-to-get-current-datetime-on-windows-command-line-in-a-suitable-format-for-us
for /F "usebackq tokens=1,2 delims==" %%i in (`wmic os get LocalDateTime /VALUE 2^>NUL`) do if '.%%i.'=='.LocalDateTime.' set date=%%j
set date=%date:~0,4%%date:~4,2%%date:~6,2%
echo %date%