note 84986 added to function.getdate
| From: | chrisATcmbuckleyDOTcoDOTuk at osu1 dot php dot net | Date: | Fri, 08 Aug 2008 14:08:55 +0000 |
| Subject: | note 84986 added to function.getdate | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-143309@lists.php.net to get a copy of this message | ||
For those who want the gmgetdate function that matches the behaviour of getdate:
<?php
function gmgetdate($timestamp = null) {
if (is_null($timestamp)) { $timestamp = time(); }
$dateParts = array(
'mday' => 'j',
'wday' => 'w',
'yday' => 'z',
'mon' => 'n',
'year' => 'Y',
'hours' => 'G',
'minutes' => 'i',
'seconds' => 's',
'weekday' => 'l',
'month' => 'F',
0 => 'U'
);
while (list(, $value) = each($dateParts)) {
$value = gmdate($value, $timestamp);
if (is_numeric($value)) { $value = (int)$value; }
}
return $dateParts;
}
?>
----
Server IP: 92.48.100.16
Probable Submitter: 212.50.188.101
----
Manual Page -- http://www.php.net/manual/en/function.getdate.php
Edit -- https://master.php.net/note/edit/84986
Del: integrated -- https://master.php.net/note/delete/84986/integrated
Del: useless -- https://master.php.net/note/delete/84986/useless
Del: bad code -- https://master.php.net/note/delete/84986/bad+code
Del: spam -- https://master.php.net/note/delete/84986/spam
Del: non-english -- https://master.php.net/note/delete/84986/non-english
Del: in docs -- https://master.php.net/note/delete/84986/in+docs
Del: other reasons-- https://master.php.net/note/delete/84986
Reject -- https://master.php.net/note/reject/84986
Search -- https://master.php.net/manage/user-notes.php