Picture of Edward 932
Registered 12 years 148 days
Edward 932 Friday, 3 June 2016, 11:52 AM
Change Summertime more than one time a year (Ramadan)
Hi everybody,
we have a location in Marocco and they change every year the summertime twice. Next weekend they change regarding Ramadan from UTC+1 to UTC and at 10th of July they change it back.
Next year the change is completely different (regarding Ramadan). Is there any possibility to overtake the time from local timeserver without offset?

Regards

Ed
Picture of Edward 932
Registered 12 years 148 days
Edward 932 Friday, 3 June 2016, 11:54 AM
Re: Change Summertime more than one time a year (Ramadan)
I saw it's the wrong forum!

Could somebody move this entry to the discussion.

Sorry

Ed
Picture of Christoph Künkel (innovaphone)
Moderator Registered 15 years 132 days
Christoph Künkel (innovaphone) Friday, 3 June 2016, 12:36 PM in response to Edward 932
Re: Change Summertime more than one time a year (Ramadan)
Did you try "UTC0" as timezone string?
According to www.png www.di-mgt.com.au: wclock/tz.html this should be UTC+0 with no DST.

You would set this as String in fish-help.png Services/NTP and set Timezone to Other.

Christoph
Picture of Edward 932
Registered 12 years 148 days
Edward 932 Monday, 6 June 2016, 05:58 PM
Re: Change Summertime more than one time a year (Ramadan)
The problem is not to find the correct timezone! The problem is to change the time. They are changing this year on 27.03 to summertime, on 05.06 to wintertime, on 10.07 back to summertime and on 30.10 back to wintertime.

And next year the change is different than this year regarding Ramadan!!!!

This is the challenge wink
Picture of Christoph Künkel (innovaphone)
Moderator Registered 15 years 132 days
Christoph Künkel (innovaphone) Monday, 6 June 2016, 06:12 PM
Re: Change Summertime more than one time a year (Ramadan)
I understand. However, my answer should be the answer to your question Is there any possibility to overtake the time from local timeserver without offset? smile

Unfortunately, there is neither support for multiple on/off DST schedules nor for moving dates in TZ. So I guess the best you can do is to supply TZ via DHCP and change it at the right time.

Or you find an NTP server that supplies correct local time instead of UTC and use UTC0 as TZ.

Christoph
Picture of Thomas Ackermann (innovaphone)
Moderator Registered 12 years 131 days
Thomas Ackermann (innovaphone) Tuesday, 7 June 2016, 09:17 AM
Re: Change Summertime more than one time a year (Ramadan)
Hi Christoph,

did you find a official specification for the timezone string syntax?
(e.g. "CET-1CEST-2,M3.5.0/2,M10.5.0/3")
As far as I understand this is wherein the switch between standard time and daylight saving time (and back) is encoded.
This is what the phones decode and use to turn the received NTP UTC timestamp into local wall clock time.
Right?

Can there really only 2 switches be encoded?
I don't want to believe that this is so cheaply defined?

/Thomas
Picture of Christoph Künkel (innovaphone)
Moderator Registered 15 years 132 days
Christoph Künkel (innovaphone) Tuesday, 7 June 2016, 11:48 AM
Re: Change Summertime more than one time a year (Ramadan)
POSIX says:

TZ
This variable shall represent timezone information. The contents of the environment variable named TZ shall be used by the ctime(), ctime_r(), localtime(), localtime_r() strftime(), mktime(), functions, and by various utilities, to override the default timezone. The value of TZ has one of the two forms (spaces inserted for clarity):
:characters 

or:

std offset dst offset, rule 

If TZ is of the first format (that is, if the first character is a <colon>), the characters following the <colon> are handled in an implementation-defined manner.

The expanded format (for all TZ s whose value does not have a <colon> as the first character) is as follows:

stdoffset[dst[offset][,start[/time],end[/time]]]  
So I guess it is defined in "cheaply" indeed.
You could of course implement :ramadan in an implementation-defined manner smile
Picture of Thomas Ackermann (innovaphone)
Moderator Registered 12 years 131 days
Thomas Ackermann (innovaphone) Tuesday, 7 June 2016, 12:01 PM
Re: Change Summertime more than one time a year (Ramadan)
Ok.

Anyone here in the forum able to create the 2 time zone strings for Morroco for 2016?
Actually we only need one for the remaining year:
- Switch to Summer Time (UTC+1) at 10th of July.
- Return to Normal Time (UTC+0) at on the last Sunday of October.

/Thomas

PS:
https://en.wikipedia.org/wiki/Daylight_saving_time_in_Morocco
Picture of Edward 932
Registered 12 years 148 days
Edward 932 Tuesday, 7 June 2016, 12:00 PM in response to Thomas Ackermann (innovaphone)
Re: Change Summertime more than one time a year (Ramadan)
Hi Thomas,

the problem is not the change (also not the change 4 times a year).
The problem is that this years the change is in June and next year it's at the end of Mai and in 2018 it's in the middle of Mai ....
And I don't want to make this changes manually!

Regards

Ed
Picture of Thomas Ackermann (innovaphone)
Moderator Registered 12 years 131 days
Thomas Ackermann (innovaphone) Tuesday, 7 June 2016, 12:04 PM
Re: Change Summertime more than one time a year (Ramadan)
No other way than doing it manually.
Since the date of changing is not fixed.
Especially if Ramadan moves into Normal Time period (not breaking the summer time).

/Thomas

Picture of Edward 932
Registered 12 years 148 days
Edward 932 Tuesday, 7 June 2016, 12:02 PM in response to Christoph Künkel (innovaphone)
Re: Change Summertime more than one time a year (Ramadan)
I try to use a local Timeserver and use UTC0 without offset.
Picture of Thomas Ackermann (innovaphone)
Moderator Registered 12 years 131 days
Thomas Ackermann (innovaphone) Tuesday, 7 June 2016, 12:16 PM
Re: Change Summertime more than one time a year (Ramadan)
Anyone knowing how Windows (or any other OS) solves this problem?
Does Windows (or any other OS) display the correct time without any changes in the Timezone String?
If so, how do they achieve?

/Thomas
Picture of Thomas Ackermann (innovaphone)
Moderator Registered 12 years 131 days
Thomas Ackermann (innovaphone) Tuesday, 7 June 2016, 05:17 PM
Re: Change Summertime more than one time a year (Ramadan)
Here is the official "Time Zone Database" maintained by IANA: http://www.iana.org/time-zones
The only reliable way of turning UTC into local wall clock time is to import this rules on every firmware release and apply them.

For a dozen built-in Timezones:
"Europe - Central European Time (UTC+1)",
"Europe - East European Time (UTC+2)",
"Europe - West European Time (UTC)",
...

we have built-in POSIX timezone strings:
"CET-1CEST-2,M3.5.0/2,M10.5.0/3",
"EEST-2EEDT-3,M3.5.0/3,M10.5.0/4",
"GMT0BST-1,M3.5.0/1,M10.5.0/2",
....

Even this information is more ten years old (not regularly checked if still valid).
For all other localities we leave it up to the user to select "Other" and enter a proper POSIX timezone string.
But as we learned you cannot put Morocco time into a POSIX timezone string at all.
For 2 reasons:
  1. there are 4 switches between Normal time and DST (not only 2)
  2. the switch dates are not fixed (due to moving Ramadan)

The perfect solution would be moving away from the POSIX tz strings whith all their disadvantages (https://www.ibm.com/developerworks/aix/library/au-aix-posix/)
and applying the RULES from the IANA database instead.

But that's a big development project!

Workaround is:

  1. select "Other"
  2. construct a tz string for the first period of DST (march until beginning of Ramadan)
  3. if Ramadan has started: change tz string for the second period of DST (end of Ramadan until october)

/Thomas

Picture of Christoph Künkel (innovaphone)
Moderator Registered 15 years 132 days
Christoph Künkel (innovaphone) Tuesday, 7 June 2016, 12:22 PM in response to Edward 932
Re: Change Summertime more than one time a year (Ramadan)
yes, I think this is the way to go.
One word of wisdom, err warning, though: any device that uses timestamps (e.g. call lists, webdav files, ...) will save those times as UTC qand will assume that NTP delivers UTC. In effect, these time will be wrong!

Christoph
← You can define your color theme preference here