The PHP date("I") returns either a 0 or 1 depending on if the current date is in daylight savings. However, i need this exact function to return a 0 or 1 for a specified date and time in the future or past.
Any ideas how this can be achieved?
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.
Just pass the timestamp of the future date like this:
See PHP
date()documentation****** EDIT:******
To properly get the daylight saving information you need to make sure that your default locale is set to a country using daylight saving. The list of countries using daylight savings can be found here.
To change the default time zone use
date_default_timezone()as follows: