Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9151611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:50:44+00:00 2026-06-17T11:50:44+00:00

The PHP date(I) returns either a 0 or 1 depending on if the current

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T11:50:45+00:00Added an answer on June 17, 2026 at 11:50 am

    Just pass the timestamp of the future date like this:

    is_daylight_saving = date("I", future_timestamp);
    

    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:

    date_default_timezone_set('Europe/Rome'); // Italy uses daylight saving
    echo date("I", 1366456706); // will return 1
    
    date_default_timezone_set('America/Argentina/Buenos_Aires'); // Argentina doesn't use daylight saving
    echo date("I", 1366456706);  // will return 0
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the php code for date format on my web page function starkers_posted_on()
This PHP statement date('Y-m-d',1281394800) returns different values in different servers. One gives me 2010-08-09
I get php output function from another function and it always returns date in
How do I write a function in PHP that returns the date of delivery
I have a bizzare problem with php date function. code: $numDays = 8; $date
Nota: this is not a duplicate of Translating PHP date() for Multilingual Site .
I am using PHP's date function. The statement is as simple as $t= 1339455660;
PHP code: echo date(c); //out put like this 2012-06-19T20:37:44+05:30 echo date(d M, Y); //out
I'm trying to modify a voting script(Thumbsup) I need this query to only return
Possible Duplicate: PHP DateTime::days returns trash? Ok, I don't get this... Could someone explain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.