How to determine whether the specified time is a daylight saving time? how to determine whether to use the U.S. daylight saving 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
}
Reply to discussion (solution)
Isn't the second parameter of date used to specify the time?
The second parameter does not seem to work...
$ LastUpdateint = 13819522810;
Echo date ("I", lastUpdateint );
The returned result is 0 ....
I don't know if my understanding of the timer is incorrect. it's just a human setting.
The timestamp is the number of seconds from January 1, 1970 to a certain time point. different countries may have different local time in different time periods.
But how can you conclude that the time and seconds are obtained from the United States in the hour?
If I do not understand the error, it is impossible for you to implement this requirement.
* USA DST
* From 2: 00 AM at the second week of March To 2: 00 AM at the first weeek of November
This is the start time and end time of the U.S. period ~
You need to maintain a list if the region is used ~