Macka Posted October 20, 2008 Share Posted October 20, 2008 Hi everyone, I'm having problems with the date function in a PHP script, I believe this is due to daylightsavings time coming 4 weeks early this year. I'm helping a school with their bulletin board system, which they have been running for a while now, late last year they had a problem with their time being consistently out by 1 hour (actually I have a feeling it was like that all year), I fixed this by adding a line to the top of the php script: putenv("TZ Australia/Adelaide"); This fixed the time issue, until now. The Time() function is again out by 1 hour and I believe this is due to DST starting 4 weeks early this year, and although this means the system will be back on track on the 31st of October, it would be nice if I could fix this perminantly for them. From what the Administrator has told me, he installed XAMPP 1.1.2.0 which I discovered has PHP 4.3.3, which I believe is quite out of date. (http://www.officephp.com/?blog:xampp-php-and-mysql-versions:20080813051736480150) What I want to know is if updating PHP to the latest release (5.2.6) will fix this issue and whether future DST date changes will cause the issue to reoccur. The Admin is a bit warty of updating to the latest version of XAMPP and wants to avoid any unnecessary complications, hence it hasnt been updated since its initial install. Also, if updating PHP will fix the issue, is there anything special that needs to be done eg uninstall the current PHP version and install the new version or download an upgrade version. I dont do very much work with PHP at all, so any help will be greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/129177-time-incorrect-due-to-new-dst-change-over-date/ Share on other sites More sharing options...
PFMaBiSmAd Posted October 20, 2008 Share Posted October 20, 2008 http://pecl.php.net/package/timezonedb/ Link to comment https://forums.phpfreaks.com/topic/129177-time-incorrect-due-to-new-dst-change-over-date/#findComment-669714 Share on other sites More sharing options...
Macka Posted October 20, 2008 Author Share Posted October 20, 2008 Awesome, thank you, I've been searching for ages and found nothing. 2 (quick?) questions: 1) How does one install this 2) Do I need to change the PHP scripts at all? Link to comment https://forums.phpfreaks.com/topic/129177-time-incorrect-due-to-new-dst-change-over-date/#findComment-669722 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.