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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.