Whether the specified time is in summer

Source: Internet
Author: User
How can I determine whether the specified time is a daylight saving time? how can I determine whether the specified time is used to obtain the U.S. Daylight Saving Time? I know I can write a function to determine whether the current time is an American daylight saving time... but I can't tell you how to judge it at the specified time .... summer order system judgment function & nbsp; is_dst () {& nbsp; $ timezonedate (e); & nbsp; get the current time zone & nbsp; & whether the specified time is in the daylight saving time system
How to determine whether to use the U.S. summer order at a specified time

I know that I can write a function to determine whether it is currently in the U.S. summer order...

But I can't tell you how to judge it at the specified time ....


// Xia Ling system judgment
Function is_dst (){
$ Timezone = date ('e'); // Obtain the current time zone
Date_default_timezone_set ('US/Pacific-new'); // force the time zone
$ Dst = date ('I'); // when determining whether to renew
Date_default_timezone_set ($ timezone); // restore the time zone
Return $ dst; // return the result

}

Share:


------ Solution --------------------
Isn't the second parameter of date used to specify the time?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.