I'm a newbie to this UNIX Timestamp concept. So got stuck with a little issue. I want to extract the Time(in hr:min:sec format and attached with am/pm word) from UNIX Timestamp (e.g. 1335959743). Can you help me in achieving the desired time format along with the string am/pm attached to it. Thanks in Advance.
Asked
Active
Viewed 1,185 times
1
-
http://php.net/DateInterval may help – BlitZ Jul 04 '13 at 12:15
3 Answers
2
Here:
date('h:i:s A', $timestamp);
The "h" is lowercase to show time in format AM/PM. If you want 12/24, use "H" (uppercase).

ivanargulo
- 326
- 1
- 5
-
Thanks once again for your precious help. Your magic did the trick for me. I've marked your answer as right. – PHPLover Jul 04 '13 at 12:47
1
Been asked before converting-a-unix-timestamp-to-formatted-date-string
echo date("H:i:s a",$timestamp);