View Full Version : time() converter

Jon W
03-09-2010, 05:35 PM
I've looked around and I can't seem to find any function that will convert a unix time stamp into readable time. The time formart I was wanting is:


Reason why is that I am working on a ajax chat system and one of the things that I was adding to this chat system is a way to mute other people for 30 minutes say if they are being offensive or whatever be the reason. When the user gets muted I wanted to have a way to tell them what time it will be that the mute will be lifted. Right now when you apply a mute in the chat system it uses the time() to figure out how long it has been and after 30 minutes there is a script that runs that lifts the mute. But all of that is beside the point. The question at hand is, is there a built in PHP function that will format the unix time into readable time?

Thanks for the help,
Jon W

03-09-2010, 05:55 PM
date() (http://php.net/manual/en/function.date.php)

date("h:i:s", $timesamp); will work;

Jon W
03-09-2010, 06:03 PM
Thanks man!