Re: get date - 1 day
- From: "Pegasus \(MVP\)" <I.can@xxxxxxx>
- Date: Thu, 20 Dec 2007 20:16:55 +0100
"Dr J R Stockton" <jrs@xxxxxxxxxxxxxxxxxx> wrote in message
news:Wa17TNWqfqaHFw08@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In microsoft.public.scripting.vbscript message <OA7VMGpQIHA.1188@TK2MSFT
NGP04.phx.gbl>, Wed, 19 Dec 2007 23:50:25, "Pegasus (MVP)"
<I.can@xxxxxxx> posted:
"Hassan" <hassan@xxxxxxxx> wrote in message
news:emUaGwoQIHA.280@xxxxxxxxxxxxxxxxxxxxxxx
How can i get the value of the date i.e. one day minus todays date
Doing date arithmetic in a batch file is cumbersome
because you have to write your own routines to
calculate the number of days since an artifical start
date, e.g. 1 January 1970.
That's not quite true. Read alt.msdos.batch.nt to find how it has
already been done; or ask there. Also, stepping Y M D back one day at a
time, or N days, is not unduly difficult.
I am fully aware of the methods and I have tried them myself.
They involve formulae like these to calculate Julian dates:
if %m% LSS 3 set /a m=%m%+12 & set /a y=%y%-1
set /a z=-719560+ %d% + (153 * %m%-2) / 5 + 365 * %y% + %y% / 4 - %y% / 100
+ y / 400
In my book this is a little more involved than writing
DateAdd("d", -1, Date())
.
- Follow-Ups:
- Re: get date - 1 day
- From: Dr J R Stockton
- Re: get date - 1 day
- References:
- get date - 1 day
- From: Hassan
- Re: get date - 1 day
- From: Pegasus \(MVP\)
- Re: get date - 1 day
- From: Dr J R Stockton
- get date - 1 day
- Prev by Date: Re: get date - 1 day
- Next by Date: Re: Preserving folder structure
- Previous by thread: Re: get date - 1 day
- Next by thread: Re: get date - 1 day
- Index(es):
Relevant Pages
|