Forum Moderators: coopster

Message Too Old, No Replies

How to add dates

         

romzinho2k7

2:02 pm on Sep 18, 2006 (gmt 0)

10+ Year Member



Hi friends,

How I can use strtotime() in a date defined for me?

Eg: date("2005/05/18", strtotime("+15 days"));

OBS: I cannot use date("Ymd", strtotime("+20 days")); because I necessary to add the date that the operation was made, or either, it can have today been as last year. It would have as I to make this?

Thanks

Psychopsia

2:47 pm on Sep 18, 2006 (gmt 0)

10+ Year Member



Hi!
Try with this:

$t = strtotime [php.net]("+15 days", mktime [php.net](0, 0, 0, 5, 18, 2005));

and then format the date with:

date [php.net]('Y m d', $t);

Hope this helps.

[edited by: Psychopsia at 2:55 pm (utc) on Sep. 18, 2006]

romzinho2k7

3:35 pm on Sep 18, 2006 (gmt 0)

10+ Year Member



Hi

I find that it helped me yes:)

I go to make plus some tests to see if ok is everything and comes back to postar. Since already thanks!