Wrong daylight saving time

Asked

Viewed 3,255 times

7

I’m having a problem regarding daylight savings time... actually cell phones, street clocks, my pc also set the clock forward...

Daylight saving time usually starts in October. But, not to coincide with the election date, President Michel Temer signed a decree at the end of 2017 postponing the period to November.

I’ve noticed that some websites are on daylight savings. From what I’ve been reading, it’s Apache who has the role of managing when summer time starts and ends.

The point is - our schedule has been postponed and no one spoke pro apache (rs). What would be the way to update apache to the correct dates, without have to do tricks in PHP of the type (hora - 1)?

  • 1

    Curious, I did not install the update KB yet, but the time is correct but indicating that it is in the time zone: Mon, 22 Oct 2018 06:10:41 -0200

3 answers

7


If the problem is in the OS

Under Linux you need to do an update, which will probably bring the correct TZDATA (Apache takes OS). If you are going to manually correct, you have to see where your distro stores daylight saving time data (not to be confused with time zones, nor with NTP).

If it’s windows, you have a specific KB for this year’s daylight savings time in the updates, in case your OS hasn’t updated automatically (which seems to be the case). - In the case of Windows, follow the link to 2019:

http://www.catalog.update.microsoft.com/search.aspx?q=4501226

If the problem is in PHP

PHP has "timezonedb", which plays the role of "table" of summer times per year and geographic region. In this case, update by this package: http://pecl.php.net/package/timezonedb


Eventually you may need to restart some service (The page server, or the PHP service if it was installed as some kind of CGI)

  • I am trying to install this extension in wamp 3.1.0. wamp even recognizes the . dll in the folder but says it is not in php.ini. Have some secret to install it in wamp?

  • It should only work by changing the original, without needing anything else. You tried to install manually or used PECL?

  • Manually. Conaegui after all. vdd needed to be version 2018.7 I was installing the 2018.3..

  • @Matheus is glad that solved.. although tomorrow already loses the sense right, because the schedule changes :D

  • Yeah, I would have known that, now the problem’s solved itself. I wonder if this update corrected only the year 2018 or if they set as standard, from 2018 onwards, the start date of daylight saving time as November 4... Will q year q have another patch of these? xD

  • @Matheus every year is an entry in the Timezone table, so you have to stay smart with the patches. There is a country that changes summer time, always on the same date, always works. Brazil is year by year, it varies. Elections generally

  • I didn’t know that Brazil was variable, I had never tried to kill myself. But I’ll be smart for years to come. Fortunately there are PECL patches :)

Show 2 more comments

2

Windows:

  • Publish the DLL php_timezonedb.dll in the PHP extensions directory. Ex.: "c: php ext"

Link to the DLL download: https://pecl.php.net/package/timezonedb

  • Add the "Extension=php_timezonedb.dll" parameter in the php.ini file

  • Restart the APACHE service

Linux:

OBS.: It may be that dependency faults that needed to be resolved before the command is successfully executed.

  • add line "Extension=timezonedb.so" in php.ini file

  • Restarting the httpd service

1

If the problem is in PHP (my version is 5.5):

Install php55-devel using the command:

sudo yum install php55-devel

then install timezonedb using the command:

sudo pecl install timezonedb

then open your php.ini file, in the folder where it is located:

sudo nano /etc/php.ini

and add the following line and save the file:

extension=timezonedb.so

then restart apache with the command:

sudo service httpd restart

Browser other questions tagged

You are not signed in. Login or sign up in order to post.