Re: Get today's date no matter what format is in use.
From: cli_happy (cli_happy_at_yahoo.com)
Date: 08/24/04
- Next message: Doug Watt: "Defrag from Scheduled tasks"
- Previous message: Stuart Carnie: "Re: cmdEX.exe - augmenting the existing CMD.EXE"
- In reply to: guard: "Re: Get today's date no matter what format is in use."
- Messages sorted by: [ date ] [ thread ]
Date: 24 Aug 2004 14:29:00 -0700
Since it's always nice to have a few options, here's the little
snippet I typically use to grab dates for creating log files, etc.
date /t | gawk {print$2} | sed "s/\//_/g" > c:\tmp.txt
for -F %%s in (C:\tmp.txt) do set DATESTR=%%s
Those gawk and sed versions used were from
http://unxutils.sourceforge.net/. If you haven't worked with sed
before, basically that statement is a global search and replace. If
you want something other than an underscore, just replace that section
of the statement.
Hope that helps!
- Next message: Doug Watt: "Defrag from Scheduled tasks"
- Previous message: Stuart Carnie: "Re: cmdEX.exe - augmenting the existing CMD.EXE"
- In reply to: guard: "Re: Get today's date no matter what format is in use."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|