Code: Select all
function mydateformat($thisdate, $dateformat='d M Y G:i', $span=0)
{
global $cal_config;
if ($cal_config['cal_dateformat']) {
$dateformat = $cal_config['cal_dateformat'];
}
// date comes in as the following:
$myr = substr($thisdate, 0, 4);
$mym = substr($thisdate, 5, 2);
$myd = substr($thisdate, 8, 2);
$myh = substr($thisdate, 11, 2);
$myn = substr($thisdate, 14, 2);
$mys = substr($thisdate, 17, 2);
if ($span || ($myh=='00' && $myn=='00' && $mys=='00')) {
// Need to strip out any TIME references so...
$timerefs = array ('a','A','B','g','G','h','H','i','I','s');
while (list(,$val) = each ($timerefs))
{
$dateformat = ereg_replace($val, "", $dateformat);
}
// strip out any characters used for time
$dateformat = ereg_replace('[:\.]', " ", $dateformat);
}
$returndate = date($dateformat, mktime ($myh,$myn,$mys,$mym,$myd,$myr));
return $returndate;
}
Code: Select all
mktime() expects parameter 1 to be long,
mktime() expects parameter 3 to be long,
Lösung:
Code: Select all
$returndate = date($dateformat, mktime ($myh+0,$myn+0,$mys+0,$mym+0,$myd+0,$myr+0));