note 19980 deleted from function.getdate by bobby
| From: | bobby@php.net | Date: | Fri, 08 Sep 2006 14:43:02 +0000 |
| Subject: | note 19980 deleted from function.getdate by bobby | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-116912@lists.php.net to get a copy of this message | ||
Note Submitter: squagmire at yaspoo dot com
----
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);
}