PC Review


Reply
Thread Tools Rate Thread

How can I get Next month of todays ?

 
 
Agnes
Guest
Posts: n/a
 
      21st Oct 2004
e.g today is 23-12-2004, i should get nextmonth of today 23-01-2005
I know DaysAdd(noofdays) ,but I don't know noofdays should be 30 or 31 ?
Thanks a lot


 
Reply With Quote
 
 
 
 
Imran Koradia
Guest
Posts: n/a
 
      21st Oct 2004
Use the Datetime.AddMonths method. You don't have to worry about 30 or 31
days. AddMonths will take care of it.

' This will give 23-01-2005
Dim dt As DateTime = DateTime.Parse("23-12-2004").AddMonths(1)

hope that helps..
Imran.

"Agnes" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> e.g today is 23-12-2004, i should get nextmonth of today 23-01-2005
> I know DaysAdd(noofdays) ,but I don't know noofdays should be 30 or 31 ?
> Thanks a lot
>
>



 
Reply With Quote
 
Jay B. Harlow [MVP - Outlook]
Guest
Posts: n/a
 
      21st Oct 2004
Agnes,
Given a DateTime variable, you can use DateTime.AddMonths to add months.

Dim today As DateTime = #12/23/2004#
Dim nextMonth as DateTime = today.AddMonths(1)

DateTime also has methods for adding Days, Hours, Minutes, Milliseconds, and
Seconds to a DateTime value.

Hope this helps
Jay

"Agnes" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> e.g today is 23-12-2004, i should get nextmonth of today 23-01-2005
> I know DaysAdd(noofdays) ,but I don't know noofdays should be 30 or 31 ?
> Thanks a lot
>
>



 
Reply With Quote
 
Agnes
Guest
Posts: n/a
 
      21st Oct 2004
Thanks a lot
"Jay B. Harlow [MVP - Outlook]" <(E-Mail Removed)> ¦b¶l¥ó
news:eV7eH%(E-Mail Removed) ¤¤¼¶¼g...
> Agnes,
> Given a DateTime variable, you can use DateTime.AddMonths to add months.
>
> Dim today As DateTime = #12/23/2004#
> Dim nextMonth as DateTime = today.AddMonths(1)
>
> DateTime also has methods for adding Days, Hours, Minutes, Milliseconds,

and
> Seconds to a DateTime value.
>
> Hope this helps
> Jay
>
> "Agnes" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > e.g today is 23-12-2004, i should get nextmonth of today 23-01-2005
> > I know DaysAdd(noofdays) ,but I don't know noofdays should be 30 or 31 ?
> > Thanks a lot
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
if todays date is in the month of january, then specific drop down list, if feb, another list, etc bjohnson Microsoft Excel Programming 1 19th Sep 2007 01:15 PM
todays date in month/week views =?Utf-8?B?ZGFya2dyYWNl?= Microsoft Outlook Calendar 2 16th May 2007 03:42 AM
how do i highlight todays date in month view =?Utf-8?B?SkQ=?= Microsoft Outlook Calendar 0 29th Aug 2006 04:35 PM
adding a month onto todays date libby Microsoft Excel Programming 5 9th Jul 2004 07:56 PM
Making todays date format to just month Lisa Microsoft Access Reports 1 21st Apr 2004 10:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:04 PM.