The PHP function date("H:i (d.m.Y)",$timestamp)represents the exact midnight at 00:00 the next day. But I need him to present him as 24:00 the previous day. Is it possible to do this without writing a completely new date () parser function?
edit: Why do I need such a "strange" format? Because my client requires it. In my country (CZ), 24:00 is sometimes used when it comes to exact midnight.
edit2: My current dirty solution: (does not work with all possible format strings)
function date_24midnight($format,$ts)
{
if(date("Hi",$ts)=="0000")
return preg_replace('/23:59/',"24:00",date($format,$ts-1));
else
return date($format,$ts);
}
source
share