Printing date in dd.mm.yyyy format in Windows Command Prompt
Printing the current date in dd.mm.yyyy format in Windows Command Prompt / CMD.
Code for .BAT file:
@ECHO OFF
FOR /F "TOKENS=1-6 DELIMS=/: " %%A IN ('ROBOCOPY "|" . /NJH ^| FIND ":"') DO (
SET "DAY=%%C" & SET "MONTH=%%B" & SET "YEAR=%%A"
)
ECHO %DAY%.%MONTH%.%YEAR%
Links
- How-to: Get the current Date - GetDate.cmd ss64.com/nt/syntax-getdate.html
- stampme.cmd anyway to make it use 2 digit month and day and am/pm ss64.com/forum/getdate.html
- How get data/time independent from localization dostips.com/forum/viewtopic.php?f=3&t=4555&start=90#p43568
Operating systems
- Windows