Ryflex Posted October 26, 2010 Share Posted October 26, 2010 Hi all, I have a database with some timestamps (in seconds) in it. Now I want to reverse it to normal readable time and date formats. Will someone tell me how please. Thnx Ryflex Link to comment https://forums.phpfreaks.com/topic/216849-seconds-to-full-date/ Share on other sites More sharing options...
marcus Posted October 26, 2010 Share Posted October 26, 2010 Just use the date() function. $time = _TIMESTAMP_; echo date("h:is F j, Y",$time); Link to comment https://forums.phpfreaks.com/topic/216849-seconds-to-full-date/#findComment-1126506 Share on other sites More sharing options...
BlueSkyIS Posted October 26, 2010 Share Posted October 26, 2010 any reason to not skip the assignment and just do? echo date("h:is F j, Y"); Link to comment https://forums.phpfreaks.com/topic/216849-seconds-to-full-date/#findComment-1126507 Share on other sites More sharing options...
Pikachu2000 Posted October 26, 2010 Share Posted October 26, 2010 Probably more efficient to do it in the query with MySQL's function. Link to comment https://forums.phpfreaks.com/topic/216849-seconds-to-full-date/#findComment-1126509 Share on other sites More sharing options...
Pikachu2000 Posted October 26, 2010 Share Posted October 26, 2010 Sorry, I hosed the BBCode tags above. Should read 'MySQL's FROM_UNIXTIME() function. Link to comment https://forums.phpfreaks.com/topic/216849-seconds-to-full-date/#findComment-1126647 Share on other sites More sharing options...
Ryflex Posted October 26, 2010 Author Share Posted October 26, 2010 thnx all works perfectly now:D:D:D:D Ryflex Link to comment https://forums.phpfreaks.com/topic/216849-seconds-to-full-date/#findComment-1126651 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.