How can I get the number of second between NOW() and a date in the database.
Thanks.
Use the TIMESTAMPDIFF function. (the TIMEDIFF function has a upper limit of 838:59:59)
SELECT TIMESTAMPDIFF(SECOND, DateColumn, NOW()) As Seconds
FROM table
Try this:
SELECT TIME_TO_SEC(TIMEDIFF(Now(), yourDateTime)) From Table;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With