Question

Timezone and Daylight Savings information can change without notice. A simple piece of legislation could alter DSL for an area and render datetime information useless for a certain area on the globe, suddenly impacting code dependent on a server's or client's local time. And, timezones only loosely reflect actual sunset/sunrise times anyway.

There are several PHP userland libraries which this unpredictable definition of "time" could affect, including DateTime, date, and others. Outside of userland, there may be internal code which relies on timezone conversions.

How does PHP's libraries account for the ever changing definitions of dates, times, and timezones?

Était-ce utile?

La solution

PHP uses the tz database, also called the zoneinfo database, IANA Time Zone Database or Olson database internally. (Although it is possible to feed it timezone data from another database of course.)

More info can be found here: http://en.wikipedia.org/wiki/Tz_database and here: http://www.iana.org/time-zones

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top