mady Posted June 16, 2009 Share Posted June 16, 2009 Hey I'm trying to change this unixtime '1245185052' into H:M A.M format, but I get a blank output why? where '.$playedat[0].' = 1245185052 <?php echo " date("H:i a" '.$playedat[0].')" ?> Quote Link to comment https://forums.phpfreaks.com/topic/162451-converting-unixtime-to-date-format/ Share on other sites More sharing options...
Maq Posted June 16, 2009 Share Posted June 16, 2009 Your syntax is off. Missing a comma, no colon, and extra quotes. echo date("H:i a", $playedat[0]); ?> Quote Link to comment https://forums.phpfreaks.com/topic/162451-converting-unixtime-to-date-format/#findComment-857474 Share on other sites More sharing options...
mady Posted June 16, 2009 Author Share Posted June 16, 2009 nopes no cigars Quote Link to comment https://forums.phpfreaks.com/topic/162451-converting-unixtime-to-date-format/#findComment-857484 Share on other sites More sharing options...
Maq Posted June 16, 2009 Share Posted June 16, 2009 This works: $playedat[0] = 1245185052; echo date("H:i a", $playedat[0]); ?> Quote Link to comment https://forums.phpfreaks.com/topic/162451-converting-unixtime-to-date-format/#findComment-857488 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.