Jump to content

Adding Days to Current Date


Recommended Posts

I'm not very good with the leap year calculation so I'm reaching out for some assistance. Anyone know how to add days to current date and get a result in date?

Here's an example of what I wanted in my program:

Current Day = 02/06/2009 (mm/dd/yyyy)

Warranty Days Left = 20

Expiration Date = 02/26/2009 (mm/dd/yyyy)

I don't have my C programming book here so I can't look it up on how to solve leap year problem, but I remember it requires the mod operation (%). I've already look on this forum, but couldn't come up with an example. Maybe my keyword is buzzard. :)

To see what I mean in picture, see the link below. Sure, I can use what's already there, but I want to modify it so I can have more than one "Warranty Days Left" entry and I want it to output to a text file.

http://www.timeanddate.com/date/dateadd.html

Thanks in advance for any help. :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...