Jump to content

Dates


steveangelis

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.