why it is giving me wrong result when convert the time is 00:00
. its
date_default_timezone_set("Asia/Karachi");
echo date("G:m", strtotime("00:00"));
echo date("G:m", strtotime("00:06"));
Output:
0:06
0:06
why it is giving me wrong result when convert the time is 00:00
. its
date_default_timezone_set("Asia/Karachi");
echo date("G:m", strtotime("00:00"));
echo date("G:m", strtotime("00:06"));
Output:
0:06
0:06
Change:
"G:m"
to
"G:i" or "H:i"
m
means month, not minute (hence you see 06 for June).
G
is for hours 0-23 without preceding zeros
H
is for hours 00-23 with preceding zeros