note 19542 added to function.strtotime
| From: | ivank at 2xtreme dot net | Date: | Sat, 02 Mar 2002 18:45:07 +0000 |
| Subject: | note 19542 added to function.strtotime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-27279@lists.php.net to get a copy of this message | ||
You can use this to parse the date you find in your apache log files:
<?
$date = "02/Mar/2002:01:31:34";
list($day, $month, $year) = explode("/", $date, 3);
# year actually has hours, minutes, seconds suffixed to it, until now:
list($year, $hour, $minute, $second) = explode(":", $year, 4);
$formdate = "$day $month $year $hour:$minute:$second";
echo strtotime ("$formdate"), "\n";
?>
--
http://www.php.net/manual/en/function.strtotime.php
http://master.php.net/manage/user-notes.php?action=edit+19542
http://master.php.net/manage/user-notes.php?action=delete+19542
http://master.php.net/manage/user-notes.php?action=reject+19542