1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 22:57:14 +02:00

Date handler am/pm fix.

This commit is contained in:
CaMer0n
2012-09-06 18:59:09 +00:00
parent bfb687dfd5
commit 9f6df8be0a

View File

@@ -514,9 +514,18 @@ class convert
} }
if($ampm && ($vals['tm_AMPM'] == 'AM' || $vals['tm_ampm'] == 'am') ) if($ampm)
{ {
$vals['tm_hour'] = intval($vals['tm_hour'] - 12); if($vals['tm_hour'] == 12 && ($vals['tm_AMPM'] == 'AM' || $vals['tm_ampm'] == 'am'))
{
$vals['tm_hour'] = 0;
}
if($vals['tm_hour'] < 12 && ($vals['tm_AMPM'] == 'PM' || $vals['tm_ampm'] == 'pm'))
{
$vals['tm_hour'] = intval($vals['tm_hour']) + 12;
}
} }
//$vals['tm_sec'] -= 1; always increasing tm_sec + 1 ?????? //$vals['tm_sec'] -= 1; always increasing tm_sec + 1 ??????