Jump to content

Question Regarding FROM_UNIXTIME and UNIX_TIMESTAMP


Kevin3374

Recommended Posts

I have a bunch of dates in a MySQL table that were inserted using FROM_UNIXTIME and stored in a field of type DATE.  When I execute a query a SELECT query using UNIX_TIMESTAMP I get nothing.  However, if I write a regular SELECT without UNIX_TIMESTAMP, I get the correct dates back, but as strings.  Anyone have any ideas on why UNIX_TIMESTAMP is causing problems.

 

Something else interesting, is when I run the query from the MySQL console itself, the query works.  But when I execute the same query from within a PHP script, I get nothing.

 

Any thoughts or tips would be greatly appreciated.

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.