LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices


Old

Getting a timestamp string in a Windows cmd.exe variable

Posted 12-12-2010 at 12:31 PM by catkin

This technique was developed to generate a timestamp string for rsync's --backup-dir option but it could be generally useful.

The first issue is that the value of %DATE% depends on Windows' regional settings so is not portable. The same goes for the output format of cmd.exe's builtin command date. (one example of many discussions: this StackOverflow thread). There is no way to program around this in a .BAT or .CMD script. The chosen solution was to UnxUtils' date.exe which is a...
LQ 5k Club
Posted in Uncategorized
Views 6354 Comments 0 catkin is offline

  



All times are GMT -5. The time now is 05:22 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration