Page 1 of 1

How to generate valid date of payments?

Posted: Tue Aug 31, 2004 9:03 am
by aldonakamura
Hi there to all.

I´m new in programming with PHP, and I´m trying to create a function to generate valid date entries. I mean... I want to do this:

1st) I get the first date
2nd) I wanna generate the next 6,12 or 24 months

So, if I input 01/09/2004, the next 6 entries will be 01/10/2004, 01/11/2004, 01/12/2004, 01/01/2005, 01/02/2005 and 01/03/2005. Right?

But if I input 31/08/2004, the next 6 entries must be 30/09/2004, 31/10/2004, 30/11/2004, 31/12/2004, 31/01/2005, 28/02/2005.

Does anybody have a function to generate these sequential dates?

Too many thanks.
My best regards,

Aldo Nakamura

Posted: Tue Aug 31, 2004 9:29 am
by timvw
[php_man]strtotime[/php_man] is magic :)