Home »
Imported messages »
comp.lang.php »
strtotime
Re: strtotime [message #175210 is a reply to message #175209] |
Wed, 24 August 2011 03:09 |
dougatmilmacdotcom
Messages: 24 Registered: May 2011
Karma:
|
Junior Member |
|
|
In article <0f753a9b-9229-4dd7-ab20-0e750ed9baed(at)m6g2000prh(dot)googlegroups(dot)com>, BKDotCom <kent(dot)brad(at)gmail(dot)com> wrote:
> Can anyone explain this to me:
>
> shouldn't these to both return the same timestamp?
>
> $ts = 1204351200;
> strtotime('+1 month',$ts); // returns 1207026000
> strtotime('@'.$ts.' +1 month')); // returns 1207029600... where's the
> extra 1 hour coming from?
http://php.net/manual/en/function.strtotime.php
"The function expects to be given a string containing an English date format
and will try to parse that format into a Unix timestamp (the number of seconds
since January 1 1970 00:00:00 UTC), relative to the timestamp given in now, or
the current time if now is not supplied."
Note in particular the the last nine words: "or the current time if now is not
supplied."
Your first call to strtotime() supplies the 'now' parameter. The second one
does not. That they do not produce the same result should not be a surprise.
|
|
|
Goto Forum:
Current Time: Mon Nov 25 02:45:14 GMT 2024
Total time taken to generate the page: 0.04388 seconds