note 84030 modified in function.strtotime by danbrown

From: Date: Mon, 18 May 2009 02:20:18 +0000
Subject: note 84030 modified in function.strtotime by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-155644@lists.php.net to get a copy of this message
When using a custom timestamp and adding a day to it, this works: <?php strtotime("20080601 +1 day"); ?> this does not: <?php strtotime("20080601") + strtotime("+1 day"); ?> that's because "+1 day" is another way to say the timestamp corresponding to tomorrow as of right now. If you do it the wrong way, you'll end up with really bizarre dates in your loops. I was going from 20080601 to 19101019 to 19490412. What fun it was figuring that out. :) --was-- When using a custom timestamp and adding a day to it, this works: strtotime("20080601 +1 day") this does not: strtotime("20080601") + strtotime("+1 day") that's because "+1 day" is another way to say the timestamp corresponding to tomorrow as of right now. If you do it the wrong way, you'll end up with really bizarre dates in your loops. I was going from 20080601 to 19101019 to 19490412. What fun it was figuring that out. :) http://php.net/manual/en/function.strtotime.php

« previous php.notes (#155644) next »