note 19980 added to function.getdate

From: Date: Mon, 18 Mar 2002 04:39:38 +0000
Subject: note 19980 added to function.getdate
Groups: php.notes 
Request: Send a blank email to php-notes+get-27896@lists.php.net to get a copy of this message
How I created a local UNIX timestamp running PHP on Windows 2000. Similar to other functions already posted here, but I figured I'd stick my two cents in. function get_time_at_page_load() { global $time_at_page_load; $temp = getdate(); $time_at_page_load = $temp['year']; $zerofill = array ( 'mon' => '-' , 'mday' => '-' , 'hours' => ' ' , 'minutes' => ':' , 'seconds' => ':' ); while( list( $name, $pfix ) = each( $zerofill ) ) { if ($temp[$name] < 10) $temp[$name] = (string)'0'.$temp[$name]; $time_at_page_load .= $pfix.$temp[$name]; } $time_at_page_load = strtotime($time_at_page_load); } -- http://www.php.net/manual/en/function.getdate.php http://master.php.net/manage/user-notes.php?action=edit+19980 http://master.php.net/manage/user-notes.php?action=delete+19980 http://master.php.net/manage/user-notes.php?action=reject+19980

« previous php.notes (#27896) next »