note 76066 deleted from function.strtotime by derick
| From: | derick@php.net | Date: | Sun, 15 Jul 2007 12:34:10 +0000 |
| Subject: | note 76066 deleted from function.strtotime by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-128540@lists.php.net to get a copy of this message | ||
Note Submitter: gordon
----
I don't know whether this functionality is intentional, but using PHP 5.1.6,
<?php
echo date( 'Y-m-d H:i:s', strtotime( "@" . strtotime( '2000-01-01
00:00:00' ) . " +1 year" ) ) . "\n";
echo date( 'Y-m-d H:i:s', strtotime( '2000-01-01 00:00:00 +1 year' ) ) .
"\n";
?>
Will output:
2000-12-31 00:00:00
2001-01-01 00:00:00
So adding a year to a time described in seconds since epoch can be different than adding a year to a
time described in YYYY-MM-DD HH:MM:SS format.