7 Replies - 42478 Views - Last Post: 30 July 2008 - 10:40 AM Rate Topic: -----

#1 aburaheemah  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 12-January 08

How to add days to a date

Posted 08 July 2008 - 04:07 AM

adding days to current date
Is This A Good Question/Topic? 0
  • +

Replies To: How to add days to a date

#2 gabehabe  Icon User is offline

  • GabehabeSwamp
  • member icon




Reputation: 1377
  • View blog
  • Posts: 10,951
  • Joined: 06-February 08

Re: How to add days to a date

Posted 08 July 2008 - 04:10 AM

First off, welcome to </dream.in.code>

I'm not sure what you want to do here. Could you expand on your problem?
Also, what language are you using? (so I know where to move this to)
Was This Post Helpful? 0
  • +
  • -

#3 aburaheemah  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 12-January 08

Re: How to add days to a date

Posted 08 July 2008 - 05:09 AM

th r programming language is vb.net.

I just want to know how to add days, months and year to the current date to know the actual future date.
Was This Post Helpful? 0
  • +
  • -

#4 gabehabe  Icon User is offline

  • GabehabeSwamp
  • member icon




Reputation: 1377
  • View blog
  • Posts: 10,951
  • Joined: 06-February 08

Re: How to add days to a date

Posted 08 July 2008 - 05:15 AM

Moved, I'm sure you'll find some good advice in the VB.NET forum :)
Was This Post Helpful? 1

#5 WayneSpangler  Icon User is offline

  • D.I.C Head

Reputation: 22
  • View blog
  • Posts: 106
  • Joined: 22-March 08

Re: How to add days to a date

Posted 08 July 2008 - 05:24 AM

MessageBox.Show(Now.AddDays(3D))
The D in 3D means Double. Now requires a double.

This post has been edited by WayneSpangler: 08 July 2008 - 05:25 AM

Was This Post Helpful? 1

#6 aburaheemah  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 12-January 08

Re: How to add days to a date

Posted 30 July 2008 - 09:04 AM

View PostWayneSpangler, on 8 Jul, 2008 - 05:24 AM, said:

MessageBox.Show(Now.AddDays(3D))
The D in 3D means Double. Now requires a double.

Was This Post Helpful? 0
  • +
  • -

#7 aburaheemah  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 12-January 08

Re: How to add days to a date

Posted 30 July 2008 - 09:25 AM

View Postaburaheemah, on 30 Jul, 2008 - 09:04 AM, said:

View PostWayneSpangler, on 8 Jul, 2008 - 05:24 AM, said:

MessageBox.Show(Now.AddDays(3D))
The D in 3D means Double. Now requires a double.

thnx for your assistance. pls, what i want is the code that will be used to add for example if the date is 02 / 04 / 2008 and one wants to add six months to the date how one will do it so that the date will be 02/10/2008.
thanks
Was This Post Helpful? 0
  • +
  • -

#8 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: How to add days to a date

Posted 30 July 2008 - 10:40 AM

Look at the methods available in the DateTime object, there is an AddMonths method that does exactly what you want.

http://msdn.microsof....addmonths.aspx
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1