Jump to content

how many years, months, weeks, days, hours, ago from datetime?


onedumbcoder

Recommended Posts

DATEDIFF(date1, date2);

 

http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html

 

It returns on days, but you can apply some divisions to get all the info you want.

 

More specifically, using TIMEDIFF would give back not only days, but hours/minutes/seconds as well.

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.