Jump to content

error getting while finding the time difference


bindiya

Recommended Posts

i have a mysql query nto find the time difference between current time and the time in the databse table filed.

but i get error.the datatype used in table is time.the time difference should be displayed in hours

 

my query is

SELECT TIMEDIFF(curtime, date_posted) FROM page_view

 

here date_posted is my field in the table.

what type of field is date_posted... datetime, unix timestamp, etc?

In TIMEDIFF() you need both the times/dates to be of the same type...

 

And do you just want the time difference, or the date difference, or both?

date & time functions

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.