Yesterday's datestamp

garcon

Well-known member
Joined
Dec 13, 2004
Messages
47
Programming Experience
Beginner
Folks,

I'm generating today's timestamp (in format: YYYYMMDD) using the following code:

VB.NET:
[size=2][color=#0000ff]Dim[/color][/size][size=2] dateString [/size][size=2][color=#0000ff]As[/color][/size][size=2] [/size][size=2][color=#0000ff]String[/color][/size][size=2] = [/size][size=2][color=#0000ff]Date[/color][/size][size=2].Now.ToString("yyyyMMdd")[/size]

Thing is though - I want to generate yesterday's datestring in the above format and the day before and the daye before etc...

Trick one this - anyone with any ideas/suggestions?
Thanking you,
G.
 

TPM

Well-known member
Joined
Dec 7, 2004
Messages
623
Location
CA
Programming Experience
3-5
dim the date.today,dim a timespan, set the timespan to 1 day, than date.subtract(timespan)

TPM
 
Top Bottom