Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in ASP .NET only
Search
Advanced Search
Forums
Product Launch
Updates
Today's Posts
Member List
Calendar
Home
Forum
Topic
ASP .NET
get date
Collapse
This topic is closed.
X
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
Mike
#1
get date
Apr 2 '08, 12:35 PM
If I have a date such as 4/2/2008, is there a way to go back a month such as
3/2/2008?
Hans Kesting
#2
Apr 2 '08, 12:55 PM
Re: get date
Mike explained :
If I have a date such as 4/2/2008, is there a way to go back a month such as
3/2/2008?
DateTime dt = new DateTime(2008,4 ,2);
dt = dt.AddMonth(-1);
Hans Kesting
Comment
Post
Cancel
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
#3
Apr 2 '08, 12:55 PM
RE: get date
DateTime myDate = DateTime.Parse( "4/2/2008");
DateTime olderDate = myDate.AddMonth s(-1);
-- Peter
Site:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
Short Urls & more:
http://ittyurl.net
"Mike" wrote:
If I have a date such as 4/2/2008, is there a way to go back a month such as
3/2/2008?
>
>
>
>
Comment
Post
Cancel
Mike
#4
Apr 2 '08, 01:05 PM
Re: get date
I've tried it and it gives me this error when I try to compile it:
DateTime dt = new DateTime(2008,4 ,2);
dt = dt.AddMonth(-1);
Error 24 'System.DateTim e' does not contain a definition for 'AddMonth'
"Hans Kesting" <invalid.hansdk @spamgourmet.co mwrote in message
news:mn.13797d8 47e488316.82533 @spamgourmet.co m...
Mike explained :
>If I have a date such as 4/2/2008, is there a way to go back a month such
>as 3/2/2008?
>
DateTime dt = new DateTime(2008,4 ,2);
dt = dt.AddMonth(-1);
>
>
Hans Kesting
>
>
Comment
Post
Cancel
Mike
#5
Apr 2 '08, 01:05 PM
Re: get date
I got it, its dt.AddMonths(-1);
"Hans Kesting" <invalid.hansdk @spamgourmet.co mwrote in message
news:mn.13797d8 47e488316.82533 @spamgourmet.co m...
Mike explained :
>If I have a date such as 4/2/2008, is there a way to go back a month such
>as 3/2/2008?
>
DateTime dt = new DateTime(2008,4 ,2);
dt = dt.AddMonth(-1);
>
>
Hans Kesting
>
>
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment