Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion create a new directory based upon the date

View parsed - Show only message text

From: m...@nospam.optusnet.com.au (Michael Jerkovic)
Subject: Re: create a new directory based upon the date
Date: 2000/04/14
Message-ID: <8F16DBDC2maj@203.2.75.243>#1/1
X-Deja-AN: 611068436
References: <sf9r8unhaln174@corp.supernews.com> <38F4FA61.4FD8CBB@uclink4.berkeley.edu> <38F5DDC5.3ED018CE@pressroom.com> <38F6393D.6A29224E@uclink4.berkeley.edu>
X-Trace: nnrp01.syd.optusnet.com.au 955710854 27504 198.142.40.2
Organization: Michael Jerkovic
User-Agent: Xnews/03.03.12
Newsgroups: alt.msdos.batch.nt

Phil, Tom

I've often used this bit of code to return date information independent
of regionial settings. It is someting I had to develop as my the company
I work for is multinationial. 

The reason this works is because date command will display something
like: 

The current date is: Fri 14/04/2000
Enter the new date: (dd-mm-yy)

The useful bit there is the dd-mm-yy.  From this I know that the 14 is dd
04 is mm and 2000 is yy.  So after running the following, %dd%  will be
the day of the month, the %mm% will be the month and the %yy% will be the
year. 

for /f "tokens=2-4 skip=1 delims=(-)" %%i in ('echo.^|date') do (
   for /f "tokens=1-4 delims=/ " %%m in ('date /t') do (
      set day=%%m
      set %%i=%%n
      set %%j=%%o
      set %%k=%%p
   )
)

so echo %yy%%mm%%dd% will give me 20000414

Michael


Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google