RE: [PHP] time problem
| From: | Benton Jackson | Date: | Tue, 04 Jul 2000 15:11:39 +0000 |
| Subject: | RE: [PHP] time problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-4759@lists.php.net to get a copy of this message | ||
Something to do with daylight savings time maybe?
> From: Lukasz Michalski
>
> stephan.schoell@chhos.mail.abb.com wrote:
>
> > Because on 1970-01-01 00:00:00 the "Unix Epoch" started. That's
> the base of the
> > unix-timestamp, which counts the seconds from then. With the
> date function, you
> > can pass a unix timestamp as second argument to be converted to
> a readable date
> > format. If you don't pass a second, you will get the actual
> date/time (kind of
> > now()). In your example you told the date() function to convert
> the timestamp
> > "0" to a readable date/time string.
> >
> >
>
> I know that Epoch is on 1970-01-01 00:00:00 :)
> Look at my example a little bit longer - on my system epoch is
> one hour later ?
> In example below there is something that I don't undestand -
> first it displays
> 28000 seconds from unix epoch wrongly - it shows 09:00:00 instead
> of 08:00:00 but
> then, when I add current day,year and month it shows 08:00:00 -
> hour has changed
> but i don't messed with hours there.....
>
> I wonder when it losts this one hour ?
>
> greetings
>
> Łukasz Michalski
>
>
>
> > Hi,
> >
> > Can anybody could explain to me why date("Y-m-d H:i:s",0) returns
> >
> > 1970-01-01 01:00:00
> >
> > instead of
> >
> > 1970-01-01 00:00:00 ?
> >
> > And another strange example:
> >
> > <?
> > $date = 28800; //8 hours
> > since epoch
> > echo "idpv:".date("Y-m-d h:i:s",$date)."<br>";
> > //shows 1970-01-01
> > 09:00:00 ??????????????
> > $date += mktime(0,0,0,date("m"),date("d"),date("Y"));
> > echo "idv:".date("Y-m-d h:i:s",$date)."<br>"; shows
> > 2000-07-04 08:00:00
> > ?>