Daylight savings time.

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Daylight savings time.

Postby mikelee » 09. March 2009 20:35

I am running the server on a computer with windows 2000 Pro.
We had a daylight time change on the weekend and I changed the system time to reflect that.

For some reason a php script that uses the system time is recording the time based on the old settings (one hour difference).
Is there something I need to modify in the Apache server?

Any suggestions would be appreciated.

Thanks.
mikelee
 
Posts: 1
Joined: 09. March 2009 20:30

Re: Daylight savings time.

Postby Izzy » 10. March 2009 01:00

No need to add anything to the server but adding a line to a particular script that relies on your local time zone can be all that is required.

Add this as the very first line (no spaces above), the very top of the page above everything else including the W3C Document declaration:
Code: Select all
<?php
date_default_timezone_set('Australia/Brisbane');
?>
Or if <?php is your very first line then add the above time zone line as the first line under it.

Use this link below to get your own local time zone and replace only the Australia/Brisbane part with your own TZ - leave everything else as is:
http://www.php.net/manual/en/timezones.php
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 171 guests