Re: get date - 1 day
- From: Dr J R Stockton <jrs@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 21 Dec 2007 13:21:57 +0000
In microsoft.public.scripting.vbscript message <#YcHjzzQIHA.1204@TK2MSFT
NGP03.phx.gbl>, Thu, 20 Dec 2007 20:16:55, "Pegasus (MVP)"
<I.can@xxxxxxx> posted:
"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:
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())
Of course. But you put "write your own", which does not have the same
meaning as "copy someone else's".
Please note that VBScript cannot, unaided, determine true Julian Dates,
because they change, by definition, at noon GMT. It can determine
Chronological Julian Date, which changes at midnight local time. But
CJD is currently 2454456 and the above expression yields something much
smaller - about 13868 I think, so that's something like Chronological
Modified Julian Date or Chronological Truncated Julian date but with an
origin not normally used in the Outside World. Yes, today is indeed
Chronological UNIX 13868 - no valid connection with a Julius.
I presume you know that fly.com is owned by Flycor in Hawaii?
--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6.
Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
.
- 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
- Re: get date - 1 day
- From: Pegasus \(MVP\)
- get date - 1 day
- Prev by Date: Re: Help with Logon Script
- Next by Date: Retrieving SID from a remote domain
- Previous by thread: Re: get date - 1 day
- Next by thread: Tough Config File Problem
- Index(es):
Relevant Pages
|