I want to manually parse the "TZONE" enviromental variable, since it seems to standard on AmigaOS3 & OS4 (and so presumably AROS & MOS). However one of the examples it provides doesn't make ANY sense to me at all.
Here's what the OS4 SDK says, but this appears to be essentially unchanged from that provided with the OS3 program SetDST from 2001:
Quote:
a global environment variable called "TZONE" which contains current time zone names and UTC (GMT) offsets.
The TZONE variable has the following format:
std offset [dst [offset]]
NOTE: spaces are for clarity only and should be omitted.
Where:
std and dst
Are 3 or more characters specifying the local standard and daylight saving time (DST) zone names.
offset
The form [-]hh:[mm[:ss]] and specifies the offset west of UTC.
If there is no offset following dst, daylight saving time is one hour ahead of standard time.
If the 'dst offset' part is absent, system time represents standard time, if it is present, system time means daylight saving time.
offset
Always specifies the absolute offset of the zone from UTC so if standard time applies, 'std offset' part should be used and if DST is in effect, the 'dst offset' should be used.
EXAMPLE
EST5
Standard time is in effect, the current timezone is called EST and you are 5 hours west of UTC.
CST-9:30CST-10:30
DST is in effect, the current timezone is called CST and you are 10 hours, 30 minutes east of UTC.
CET-1CEST
DST is in effect, the current timezone is called CEST and you are 2 hours east of UTC.
It's the last example which looks wrong to me. If we are 2 hours east of UTC, then the UTC offset is -2. The strange part is that if DST is in effect, then it means the system time is +1 hour further ahead, which is the equivalent of being 1 hour further east.
Therefore I would expect the UTC offset to be -3, but the example shows -1. Even if I assume we are supposed to calculate the DST offset ourselves, then the UTC offset is still -2. So I can't see any way in which being 2 hours east of UTC would produce a UTC offset of -1 !
The only way I *could* make sense of it is if "2 hours east of UTC" is not referring to the PHYSICAL location, but rather it was a highly obscure way of referring to the local time offset (including the 1 hour DST offset). But this seems an extremely perverse thing to do.
EDIT: OK, looks like they ARE using the "obscure way", since the previous example uses the same wierd phrasing, plus CET is officially defined as being 1 hour east of UTC.