[asterisk-users] SPA-962 & Asterisk

Tzafrir Cohen tzafrir.cohen at xorcom.com
Fri Nov 7 14:37:08 CST 2008


On Fri, Nov 07, 2008 at 12:43:47PM -0700, Wilton Helm wrote:
> >The timezone only tells the system with what offset to show
> >the time when asked for "local time".
> 
> >Sadly some operating systems have this strange concept that changing a
> >time zone means changing the system clock itself. This makes it a huge
> >change indeed.
> 
> Agreed.  The firmware I design works the same way--everything internal 
> is in UTC.  Any application that must deal with multiple time zones by 
> virtue of market distribution or because it shares time over a network, 
> etc. should use UTC internally and only translate to local time.  Using 
> a scheme such as *nix does of an integer rather than broken down field 
> makes the translation trivial.  The hard part is deciding how to 
> determine the translation, whether to use hard coded rules, intelligent 
> observation or manual setup.

The size of the whole glibc time zones distribution, if you ignore
duplicates, is:

  $ du -sh /usr/share/zoneinfo \
    --exclude=/usr/share/zoneinfo/posix \
    --exclude=/usr/share/zoneinfo/right
  2.3M    /usr/share/zoneinfo

This includes 577 files. I'm sure you can trim that down. The point is
that you then ask the user for the time zone, and don't need the "DST"
checkbox. The device will go start using DST automatically.

  $ zdump -v /usr/share/zoneinfo/America/New_York  | grep 2008
  /usr/share/zoneinfo/America/New_York  Sun Mar  9 06:59:59 2008 UTC = Sun Mar  9 01:59:59 2008 EST isdst=0 gmtoff=-18000
  /usr/share/zoneinfo/America/New_York  Sun Mar  9 07:00:00 2008 UTC = Sun Mar  9 03:00:00 2008 EDT isdst=1 gmtoff=-14400
  /usr/share/zoneinfo/America/New_York  Sun Nov  2 05:59:59 2008 UTC = Sun Nov  2 01:59:59 2008 EDT isdst=1 gmtoff=-14400
  /usr/share/zoneinfo/America/New_York  Sun Nov  2 06:00:00 2008 UTC = Sun Nov  2 01:00:00 2008 EST isdst=0 gmtoff=-18000

Thus the time zone is not "GMT+3" or "GMT-5". This the current time
zone. But it forces the user to actively change the timezone whenever
the DSP come into effect. The time zone is "USA/Eastern", "Peru", or
whatever.

And what if those definitions keep changing? e.g. if you live in Brazil?
I figure some sort of manual override, such as the explicit GMT[+-]NN zones.

And this interface would not be complete without a clock showing the
local time according to those settings, I guess.

-- 
               Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen at xorcom.com
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir



More information about the asterisk-users mailing list