For (PHP> = 5.2.0):
You can use the DateTime class. However, you may need to change the date format. I have not tried it. The following date format will be defined: YYYY-MM-DD HH-MM-SS
$date = new DateTime("2010-04-08 22:15:00"); echo $date->format("g"). '.' .$date->format("i"). ' ' .$date->format("A");
However, in my opinion, use . as a separator for 10.15 not recommended, as your users may be confused, or it is a decimal number or time format. The most common way is to use 10:15 PM
Andrei Stalbe Nov 18 '12 at 10:29 2012-11-18 10:29
source share