Thread: Date
View Single Post
Old 06-25-2009   #6 (permalink)
Steve


 
 

Re: Never mind

Pegasus [MVP] wrote:
Quote:

> "Larry" <larry328NOSPAM@xxxxxx> wrote in message
> news:%230n5paV9JHA.1340@xxxxxx
Quote:

>> I got it, very simple:
>>
>> Wscript.Echo MonthName(Month(Now())) & " " & Day(Now()-1)
>
> This does not really work since you will have serious problems on
> days such as 1 July or even worse, on 1 January. Fortunately cscript
> has a full set of date arithmethic functions such as DateAdd or
> DateDiff.
Or subtract 1 from the date first and then extract the parts:

Yesterday = Date() - 1
WScript.Echo MonthName(Month(Yesterday)) & " " & Day(Yesterday)
Quote:

> I recommend you download the helpfile script56.chm from the Microsoft
> site to see how they're used.
I endorse that recommendation!

--
Steve

Heresy is only another word for freedom of thought. -Graham Greene


My System SpecsSystem Spec