I have a query:
SELECT * FROM msc_calendar WHERE calendar_userId = 1 AND end < UNIX_TIMESTAMP()
Is there a way to subtract a week from the timestamp, i.e. to see if end was more than a week ago?
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.
@EugenRieck’s solution will break on edge cases like weeks where there’s a daylight savings switch. It’s better to use the built-in function for this,
DATE_SUB: