Re: Get today's date no matter what format is in use.

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: cli_happy (cli_happy_at_yahoo.com)
Date: 08/24/04


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!



Relevant Pages

  • Re: SEARCH enhancement
    ... >> single biggest cpu user. ... >If you don't mind freeware take a look at my GRAB search utility ... >You can find GRAB in Hunter Goatleys freeware collection at ... Do you happen to know if GRAB works on CSWS log files? ...
    (comp.os.vms)
  • doubled log messages
    ... right after the other in their respective log files. ... Weird, huh? ... kdc.conf snippet: ...
    (comp.protocols.kerberos)