Set date and time in batch file

Computer screen showing scripts and terminal output

You can use this in batch files for tagging the data and time

SET date=%DATE%
SET day=%date:~0,3%
ECHO %day%

Practical IT tips, straight to your inbox

Microsoft 365 updates, security alerts and plain-English tech advice for small businesses, emailed when we publish a new article.

We don’t spam! Read our privacy policy for more info.

Leave a Reply