note 51302 added to function.imap-fetch-overview
| From: | myzouip at freesurf dot fr | Date: | Sat, 26 Mar 2005 15:54:41 +0000 |
| Subject: | note 51302 added to function.imap-fetch-overview | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-87025@lists.php.net to get a copy of this message | ||
I have no found any functions which could convert the returned date to DATETIME... (ex: Sat, 5 Mar
2005 12:44:02 +0100). Just have maid my own function:
function get_datetime($char) {
$ENGLISH_DAY = substr($char, 0, 3);
$INT_DAY = substr($char, 5, 2);
if($INT_DAY < 10) {
$INT_DAY = substr($char, 5, 1);
$INT_YEAR = substr($char, 11, 4);
$INT_TIME = substr($char, 16, 8);
$ENGLISH_MON = substr($char, 7, 3);
$INT_DAY = "0".$INT_DAY;
}
else {
$INT_DAY = substr($char, 5, 2);
$INT_YEAR = substr($char, 12, 4);
$INT_TIME = substr($char, 17, 8);
$ENGLISH_MON = substr($char, 8, 3);
}
$MONTHS = array(
"Jan" => "01",
"Feb" => "02",
"Mar" => "03",
"Apr" => "04",
"May" => "05",
"Jun" => "06",
"Jul" => "07",
"Aug" => "08",
"Sep" => "09",
"Oct" => "10",
"Nov" => "11",
"Dec" => "12"
);
$INT_MON = $MONTHS[$ENGLISH_MON];
$DATETIME .= $INT_YEAR."-";
$DATETIME .= $INT_MON."-";
$DATETIME .= $INT_DAY." ";
$DATETIME .= $INT_TIME;
return $DATETIME;
}
----
Manual Page -- http://www.php.net/manual/en/function.imap-fetch-overview.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51302
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51302&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51302&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51302&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51302&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51302&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51302&report=yes
Search -- http://master.php.net/manage/user-notes.php