Re: time problem

From: Date: Tue, 04 Jul 2000 15:28:17 +0000
Subject: Re: time problem
Groups: php.general 
Request: Send a blank email to php-general+get-4760@lists.php.net to get a copy of this message
I'm sorry, I can't do any code checking on my office PC. So I just can give you one last hint: Take the daylight savings time options and time zone settings of the php date/time functions and of your system into consideration and trace the consequences carefully. date() takes the local time, which isn't GMT in Poland. The Epoch started at 0:00:00 GMT I guess... HTH --Steff webmaster@posh.ch 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 > ?> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#4760) next »