Jump to content

timestamp


Jaynesh

Recommended Posts

You could get the difference in seconds, and use basic math to go from there.

 

SELECT `content`, `date`, UNIX_TIMESTAMP() - UNIX_TIMESTAMP(`date`) as `difference` FROM `table`

 

Once extracted, `difference` will hold the amount of seconds between now and the post. Divide by 86400, you get days. Divide remainder by 3600, you get hours. Divide that remainder by 60, minutes. The final remainder is seconds.

Link to comment
https://forums.phpfreaks.com/topic/241812-timestamp/#findComment-1241894
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.