Re: time problem

From: Date: Tue, 04 Jul 2000 13:44:42 +0000
Subject: Re: time problem
Groups: php.general 
Request: Send a blank email to php-general+get-4742@lists.php.net to get a copy of this message
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. Refer to the man pages. http://www.php.net/manual/ref.datetime.php HTH --Steff webmaster@posh.ch www.posh.ch 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 (#4742) next »