steveangelis Posted July 20, 2008 Share Posted July 20, 2008 I looked and could not find any topics here that could help but I know it is something simple I am missing. When I leave the following out I get the unix time but when I put this in nothing gets returned: DATE_FORMAT(from_unixtime(topic_time),GET_FORMAT(DATE,'%m %d %Y')) I know the variable topic_time is there, it shows when I just query topic_time but when I add this it does not work. Any ideas? Link to comment https://forums.phpfreaks.com/topic/115714-dates/ Share on other sites More sharing options...
steveangelis Posted July 21, 2008 Author Share Posted July 21, 2008 Does anyone know? Link to comment https://forums.phpfreaks.com/topic/115714-dates/#findComment-595094 Share on other sites More sharing options...
fenway Posted July 23, 2008 Share Posted July 23, 2008 That should be: DATE_FORMAT(from_unixtime(topic_time),'%m %d %Y') Link to comment https://forums.phpfreaks.com/topic/115714-dates/#findComment-597967 Share on other sites More sharing options...
steveangelis Posted July 23, 2008 Author Share Posted July 23, 2008 I am still getting a blank return on it. It shows up without the unixtime thing but when I add it in there is nothing. Link to comment https://forums.phpfreaks.com/topic/115714-dates/#findComment-598070 Share on other sites More sharing options...
fenway Posted July 24, 2008 Share Posted July 24, 2008 What column type is topic_time? UNSIGNED INT? What does FROM_UNIXTIME(topic_time) return? How are you determining that is it blank -- I don't see a column alias, are you running this from phpmyadmin? Also, apparently, FROM_UNIXTIME() takes an optional format parameter as the second argument, so you can do: FROM_UNIXTIME( topic_time, '%m %d %Y' ) Directly. Link to comment https://forums.phpfreaks.com/topic/115714-dates/#findComment-598570 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.