-
Increment a date
My program takes in a date in the format (mm/dd/yyyy) and I want to create a method which increments that date by any number (given to us by the user). What would be the best way of doing this, assuming I can't use the calender class?
Right now I have a method which counts the number of days from the first day of the Gregorian calender, 10/15/1582, to the date that was given. What can I do with this number to get the desired result?
Any help is appreciated
Thanks
-
Re: Increment a date
Part your date into three parts. 1. day 2. month. 3. year
When you get a number, add it into day first.
And then keep on doing the mathematic part. Just think for a while and you will know the answer.