[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] time, date, and timezone



MacPerler's,

Timezones?

Don't be too simplistic.

Don't forget there there are timezones which are not integer hours
offset from GMT (I recall India is +6 1/2 hours off of GMT or +5 1/2
from London DST).
(If you don't believe me, bring up APPLE->Control Panels->Map,
 type in 'London' and then 'Calcutta'.)

>>> Since it's in Windows, it must be a bad idea 1/2 :-).
>>
>>Or it means that occasionally Windows does steal good ideas :-)
>
>Was this still about a $TZ environment var. ? It is NOT in Windows! It
>would be nice if it were, though. It's in the registry, but under different
>keys in Win95 and NT !!
>
>Windows does occasionnaly have/steal (who cares) good ideas, but this
>doesn't look like one... :-)

And apparently Microsoft, typically, is not consistent in its
appropriation of the Good Things of the universe.

>Ah, and there's another problem: sometimes the $TZ will not be numeric but
>text, and possibly ambiguous: BST should be Brazil Standard, but is
>sometimes used for British Summer, and others like this...

TZ is complicated enough, and different enough on the various systems
that do use it, that maybe MacPerl shouldn't mess with it.

from SunOS 5.5.1>  man -s 5 environ ...

     TZ          Timezone  information.   The  contents  of  this
                 environment  variable  are used by the functions
                 ctime(3C),  localtime(3C),   strftime(3C),   and
                 mktime(3C) to override the default timezone.  If
                 TZ is not in the following form, it designates a
                 path  to  a  timezone  database file relative to
                 /usr/share/lib/zoneinfo/,  ignoring  the   first
                 character  if  it  is a colon (:); otherwise, TZ
                 has the form:
                 stdoffset[dst[offset],[start[/time],end[/time]]]

                 std and dst Three or more  bytes  that  are  the
                             designation  for  the standard (std)
                             and  daylight  savings  time   (dst)
                             timezones.  Only std is required. If
                             dst is missing, then  daylight  sav-
                             ings  time  does  not  apply in this
                             locale.    Upper-   and   lower-case
                             letters are allowed.  Any characters
                             except a leading colon (:),  digits,
                             a  comma  (,), a minus (-) or a plus
                             (+) are allowed.

                 offset      Indicates the value one must add  to
                             the  local time to arrive at Coordi-
                             nated Universal  Time.   The  offset
                             has the form:
                             hh[:mm[:ss]]

                             The minutes (mm)  and  seconds  (ss)
                             are  optional.   The  hour  (hh)  is
                             required and may be a single  digit.
                             The    offset   following   std   is
                             required.  If no offset follows  dst
                             ,  daylight  savings time is assumed
                             to be one  hour  ahead  of  standard
                             time.   One  or  more  digits may be
                             used; the  value  is  always  inter-
                             preted  as  a  decimal  number.  The
                             hour must be between 0 and  24,  and
                             the minutes (and seconds) if present
                             between 0  and  59.   Out  of  range
                             values   may   cause   unpredictable
                             behavior.  If preceded by  a  ``-'',
                             the  timezone  is  east of the Prime
                             Meridian;  otherwise  it   is   west
                             (which   may   be  indicated  by  an
                             optional preceding ``+'' sign).

                 start/time,end/time
                             Indicate when to change to and  back
                             from  daylight  savings  time, where
                             start/time describes when the change
                             from  standard time to daylight sav-
                             ings  time  occurs,   and   end/time
                             describes  when the change back hap-
                             pens.   Each  time  field  describes
                             when,  in  current  local  time, the
                             change is made.

                             The formats of start and end are one
                             of the following:

                             Jn        The Julian day n (1 < n  <
                                       365).   Leap  days are not
                                       counted.  That is, in  all
                                       years,  February 28 is day
                                       59 and March 1 is day  60.
                                       It  is impossible to refer
                                       to the occasional February
                             n         The zero-based Julian  day
                                       (0  < n < 365).  Leap days
                                       are  counted,  and  it  is
                                       possible   to   refer   to
                                       February 29.

                             Mm.n.d    The dth day, (0 < d  <  6)
                                       of  week  n  of month m of
                                       the year (1 < n < 5, 1 < m
                                       <  12), where week 5 means
                                       ``the last d-day in  month
                                       m''  which  may  occur  in
                                       either the fourth  or  the
                                       fifth  week).   Week  1 is
                                       the first  week  in  which
                                       the  dth  day occurs.  Day
                                       zero is Sunday.

                             Implementation specific defaults are
                             used  for  start  and  end  if these
                             optional fields are not given.

                             The time  has  the  same  format  as
                             offset  except  that no leading sign
                             (``-'' or ``+'')  is  allowed.   The
                             default,  if  time  is  not given is
                             02:00:00.

... end quote from man -s 5 environ

--
Regards, Larry F. Allen-Tonar        (larryat@cts.com) +1 760/746-6464 (voice)
         Principal Designer                              +1 760/746-0766 (FAX,
         P.O. Box 463072                                         upon request)
         Escondido, CA  92046-3072



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch