SugarCRM Timezones for Australia Daylight Saving

The default timezones in SugarCRM are driven by the file /include/timezone/timezones.php

With changes to the Australian Daylight Saving settings this year, the timezones.php file is incorrect.

As a side note, Trivia: When was DST first used in Australia and in which states did it apply? A: below….

All states that observe DST are now consistent in the application of dates etc. So excluding Darwin, Perth, Brisbane the other capitals can all be set for starting on the first Sunday in October and ending on the first Sunday in April each year… until they change it again!

The format for each of the cities is currently set as follows (SugarCRM 5.2.0g):
[php] 
‘Australia/Adelaide’ =>
array (
‘gmtOffset’ => 570,
‘dstOffset’ => 60,
‘dstMonth’ => 10,
‘dstStartday’ => -1,
‘dstWeekday’ => 0,
‘stdMonth’ => 3,
‘stdStartday’ => -1,
‘stdWeekday’ => 0,
‘dstStartTimeSec’ => 7200,
‘stdStartTimeSec’ => 7200,
),
[/php]
For Perth it needs to be changed to remove all DST settings leaving just the
[php]
‘gmtOffset’ => 480,
[/php]
All the other capital cities need to have the start date to the first Sunday in October and ending dates changed to April which is done by changing three values.

[php]
‘Australia/Adelaide’ =>
array (
‘gmtOffset’ => 570,
‘dstOffset’ => 60,
‘dstMonth’ => 10,
‘dstStartday’ => -1, 0,
‘stdMonth’ => 3, -1, 0,
‘dstStartTimeSec’ => 7200,
‘stdStartTimeSec’ => 7200,
),
[/php]
The use of -1 in the day field indicates the last in the month rather than 1st in the month.

This should apply to Sydney, Melbourne, Hobart, Currie*, Adelaide, Broken Hill.

A final note that applying these changes to a copy of the timezones.php and placing that under /custom/include/timezone/timezones.php does not work and you need to replace the original file in /include/timezone/timezones.php

*Where is Currie? King Island. Off the coast of Tasmania and at one stage they did not observe DST while Hobart did so they had their own setting. Redundant now.

Answer to the trivia Q: Summer 1916-1917 and it was Australia wide. It then was dropped until trialling again in 1942 – 1945 and at various other times over the next 30 years until broadly accepted around 1970 across eastern states.

2 replies on “SugarCRM Timezones for Australia Daylight Saving”

  1. Hi, thanks for the tip!
    Helped me to fix time zones in our instance of Sugar.
    Are you sure your fixed array is correct?

    I made it too look like this:

    ‘Australia/Adelaide’ =>
    array (
    ‘gmtOffset’ => 570,
    ‘dstOffset’ => 60,
    ‘dstMonth’ => 10,
    ‘dstStartday’ => 1,
    ‘dstWeekday’ => 0,
    ’stdMonth’ => 4,
    ’stdStartday’ => 1,
    ’stdWeekday’ => 0,
    ‘dstStartTimeSec’ => 7200,
    ’stdStartTimeSec’ => 7200,
    ),

    Cheers,
    Paul.

Leave a Reply

Your email address will not be published. Required fields are marked *