...

View Full Version : Time to Date



Crisp
01-23-2010, 04:40 AM
Hello.
I want to turn time(); into something like "10:15" is this possible?
Here's an example:


//Time
$time = "1263696726";
//Now I want to convert $time to X:XX
//I have no idea what to do next.

I hope you can help, thanks!

Fou-Lu
01-23-2010, 04:43 AM
$time = time(); // Or whatever number you want to use
$formatted = date('H:i', $time);


Refer to the following page to see other modifiers for date format: http://php.ca/manual/en/function.date.php

Crisp
01-23-2010, 04:44 AM
Right before I saw this I figured it out, lol.
Thanks anyways!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum