HTML beginner |
|
<?php
function DateConvert($old_date, $layout)
{
setlocale(LC_ALL,'nl_NL') or setlocale(LC_ALL,'nld_NLD');
$old_date = ereg_replace('[^0-9]', ' ', $old_date);
$date_year = substr($old_date,0,4);
$date_month = substr($old_date,5,2);
$date_day = substr($old_date,8,2);
$date_hour = substr($old_date,11,2);
$date_minute = substr($old_date,14,2);
$date_second = substr($old_date,17,2);
$new_date = date($layout, mktime($date_hour + 1, $date_minute, $date_second, $date_month, $date_day, $date_year));
// $new_date = date($layout, mktime($date_hour, $date_minute, $date_second, $date_month, $date_day, $date_year));
return $new_date;
}
?>
<?php function DateConvert($old_date, $layout) { $date_year = substr($old_date,0,4); $date_month = substr($old_date,5,2); $date_day = substr($old_date,8,2); $date_hour = substr($old_date,11,2); $date_minute = substr($old_date,14,2); $date_second = substr($old_date,17,2); $new_date = date($layout, mktime($date_hour + 1, $date_minute, $date_second, $date_month, $date_day, $date_year)); // $new_date = date($layout, mktime($date_hour, $date_minute, $date_second, $date_month, $date_day, $date_year)); return $new_date; } ?>
De eerste regel $new_date heb ik bij date_hour +1 gedaan. Zo deed hij het ook : '). |