User Options - Day Light Savings
This section is pretty self explanatory and straight forward, and the examples show you how to enter the details. You need to set your timezone names or labels (eg. PST, GMT or AEDT, AEST), the correct date that your timezones changes over to daylight savings, and the amount of offset for your timezones.
// --------------------------------------------------------------------------------------
// Define rules for Auto Summer Time Display, and clock adjustment
// --------------------------------------------------------------------------------------
// Example for Australia Eastern Time Zone (Sydney, Melbourne)
// TimeChangeRule aEDT = {"AEDT", First, Sun, Oct, 2, 660}; //UTC + 11 hours
// TimeChangeRule aEST = {"AEST", First, Sun, Apr, 3, 600}; //UTC + 10 hours
// Timezone myTZ(aEDT, aEST);
// Example for Portugal
// TimeChangeRule PST = {"PST", Last, Sun, Mar, 1, 60}; //Portuguese Summer Time - "UTC + 1" or GMT + 1
// TimeChangeRule GMT = {"GMT", Last, Sun, Oct, 2, 0}; //Portuguese Winter Time - "UTC + 0" or GMT
// Timezone myTZ(PST, GMT);
TimeChangeRule aEDT = {"AEDT", First, Sun, Oct, 2, 660}; //UTC + 11 hours
TimeChangeRule aEST = {"AEST", First, Sun, Apr, 3, 600}; //UTC + 10 hours
Timezone myTZ(aEDT, aEST);
If you timezone does not have daylight savings, just configure one of the "TimeChangeRule" lines, defining the amount of time offset for your zone and then pass the same rule twice to the constructor, for example:
// Example for Brisbane, Australia
TimeChangeRule aEDT = {"AEDT", First, Sun, Oct, 2, 660}; //UTC + 11 hours
TimeChangeRule aEST = {"AEST", First, Sun, Apr, 3, 600}; //UTC + 10 hours
Timezone myTZ(aEST, aEST);
This section is pretty self explanatory and straight forward, and the examples show you how to enter the details. You need to set your timezone names or labels (eg. PST, GMT or AEDT, AEST), the correct date that your timezones changes over to daylight savings, and the amount of offset for your timezones.
// --------------------------------------------------------------------------------------
// Define rules for Auto Summer Time Display, and clock adjustment
// --------------------------------------------------------------------------------------
// Example for Australia Eastern Time Zone (Sydney, Melbourne)
// TimeChangeRule aEDT = {"AEDT", First, Sun, Oct, 2, 660}; //UTC + 11 hours
// TimeChangeRule aEST = {"AEST", First, Sun, Apr, 3, 600}; //UTC + 10 hours
// Timezone myTZ(aEDT, aEST);
// Example for Portugal
// TimeChangeRule PST = {"PST", Last, Sun, Mar, 1, 60}; //Portuguese Summer Time - "UTC + 1" or GMT + 1
// TimeChangeRule GMT = {"GMT", Last, Sun, Oct, 2, 0}; //Portuguese Winter Time - "UTC + 0" or GMT
// Timezone myTZ(PST, GMT);
TimeChangeRule aEDT = {"AEDT", First, Sun, Oct, 2, 660}; //UTC + 11 hours
TimeChangeRule aEST = {"AEST", First, Sun, Apr, 3, 600}; //UTC + 10 hours
Timezone myTZ(aEDT, aEST);
If you timezone does not have daylight savings, just configure one of the "TimeChangeRule" lines, defining the amount of time offset for your zone and then pass the same rule twice to the constructor, for example:
// Example for Brisbane, Australia
TimeChangeRule aEDT = {"AEDT", First, Sun, Oct, 2, 660}; //UTC + 11 hours
TimeChangeRule aEST = {"AEST", First, Sun, Apr, 3, 600}; //UTC + 10 hours
Timezone myTZ(aEST, aEST);

