How can I get the number of seconds between NOW () and the date in the database.
Thank.
Use the function TIMESTAMPDIFF. (function TIMEDIFFhas an upper limit 838:59:59)
TIMESTAMPDIFF
TIMEDIFF
838:59:59
SELECT TIMESTAMPDIFF(SECOND, DateColumn, NOW()) As Seconds FROM table
Try the following:
SELECT TIME_TO_SEC(TIMEDIFF(Now(), yourDateTime)) From Table;
Source: https://habr.com/ru/post/1793176/More articles:Select a specific tab in the terminal depending on the content, using application and best practices - terminalWhat should I do with unsigned char * when I need a string? - c ++LINQ to XML equivalent of XPath - c #Rails: any way to preset (enable) parent association - scopeWhere is the 'tsrm_ls' in PHP sources? - phpServer.MapPath does not return expected path - asp-classicTesting network inaccessibility on Windows Phone 7 - windows-phone-7ASP.NET MVC 3 - WebDev Server Memory Leak Using Free NHibernate? - asp.net-mvc-3ASP.Net MVC Array of Hidden Fields - asp.net-mvcPHP preg_replace regex question - phpAll Articles