Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating 2 years from a date

Status
Not open for further replies.

061178

Programmer
Jul 7, 2005
41
GB
Hi, I need to add two years onto a date in PB. I can not simply add 730 days to the date I have as this is inaccurate. I need to calculate when a leap year occurs and then add on the number of days accordingly. Can anyone point me in the right direction? Thanks.
 
Hi
add 730 days, then calcuate
if this month is 1 or 2(i think you have to exclude 29 of february) then you must see if the year is leap or the next year is leap, if one of the two are lead add 1 more day.
if this month is greater than 28 of february then you must see the next 2 year to see if some of then are leap.
If some of then is leap add 1 more day.
 
Thanks, this problem is now solve (in a similar way to your suggestion) thanks for your input
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top