I have to try and work out if a unix timestamp is between 21 days and 49 days from the current date. Can anyone help me to work this out? Thanks!
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.
Welcome to SO!
This should do it:
This can be simplified, but I thought you wanted to see a more verbose example 🙂
I get
1814400from21*24*60*60and4233600from41*24*60*60.Edit: I assumed future dates. Also note
time()returns seconds (as opposed to milliseconds) since the Epoch in PHP.This is how you do it in the past (since you edited your question):