MyBB Community Forums

Full Version: mktime (dst correction)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I know than in many countries this is used to save energy, but I want if all the countries where this is used are in diferentes dates or is in the same

For example in Mexico and the first Sunday of April all we must add one hour in the clocks and the last Sunday of Octuber we must less one hour

mktime have this argument, but I dont know for what country

If you are wondering which countries observe daylight saving time, have a read here: http://en.wikipedia.org/wiki/Daylight_Saving_Time
Hi DennisTT, about of Unix say:

Quote:Unix systems (including Linux and Mac OS X) mostly use the Zoneinfo utility which allows a single time zone to have multiple DST rules to handle changes from year to year. As soon as a rule change is announced, it can be safely added to the system. All the standard library routines which calculate times access this database, so software that queries whether a particular date will have DST in effect (for the time zone of the process) will get the correct answers as long as the time zone rule is correct for the year in question.

mktime function (http://php.net/mktime) get the TIMESTAMP and in this function can be indicated the DST like argument, but if I have many users in a site How can mktime detect the country of each user and with this get the DST of that user?, commonly PHP not have a IP by country (GEOPIP) included in mktime, I could think it, then I think than mktime can not be exact

What you think about of this?