I want to substract 5 seconds to a date so I have “Select Now() from Table”. I obtain 2011-08-30 18:31:37.0. However, the expected output is 2011-08-30 18:31:32.0. What would be the best approach to substract seconds to a date??
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
SELECT NOW() - INTERVAL 5 SECONDor
SELECT DATE_SUB(NOW(), INTERVAL 5 SECOND)whatever you like more.