unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ulf Jasper <ulf.jasper@web.de>
To: Christian Lynbech <christian@defun.dk>
Cc: Christian <christian.lynbech@tieto.com>,
	discussions <emacs-devel@gnu.org>
Subject: Re: Timezone handling problem in icalendar.el/icalendar-import-*
Date: Sat, 19 Dec 2009 13:16:29 +0100	[thread overview]
Message-ID: <843a376twi.fsf@web.de> (raw)
In-Reply-To: m2my1frjmg.fsf@defun.dk

Christian Lynbech <christian@defun.dk> writes:

>>>>>> "Ulf" == Ulf Jasper <ulf.jasper@web.de> writes:
>
> Ulf> Changed timezone names to "STD" and "DST". As I understand these are
> Ulf> just names and should consist of alphabetic characters only.
>
> Hm, perhaps. 
>
> My understanding is/was that some names are recognized (such as CET for
> central europe or PST for pacific standard time). These maps to (the
> equivalent of) GMT+1 (for CET). Ie. I thought we had a synctactic requirement
> (must start with a letter and be at least three letters long) and a
> semantic (must belong to this particular set). If a function such as
> mktime() encounters something it cannot parse it wil just assume GMT.
>
> If this is correct, why not just use "GMT" rather than "STD" and "DST"?

The timezone names "DST" and "STD" together with the time-offsets and
daylight saving time definition are passed as ZONE argument to
encode-time. This in turn fills the environment variable TZ with this
data and calls tzset. The tzset manpage says:

       The  value of TZ can be one of three formats.  The first format is used
       when there is no daylight saving time in the local timezone:

              std offset

       The std string specifies the name of the timezone and must be three  or
       more  alphabetic characters.  The offset string immediately follows std
       and specifies the time value to be added to the local time to get Coor‐
       dinated  Universal  Time  (UTC).   The  offset is positive if the local
       timezone is west of the Prime Meridian and negative if it is east.  The
       hour must be between 0 and 24, and the minutes and seconds 0 and 59.

       The second format is used when there is daylight saving time:

              std offset dst [offset],start[/time],end[/time]

       There  are  no spaces in the specification.  The initial std and offset
       specify the standard timezone, as described above.  The dst string  and
       offset  specify the name and offset for the corresponding daylight sav‐
       ing timezone.  If the offset is omitted, it default to one  hour  ahead
       of standard time.

icalendar.el uses the "second format". It sets the timezone names std
and dst to "STD" and "DST", but could use any other strings as
well. These names are irrelevant -- only the offsets and start/end times
matter.

The VTIMEZONE element in the icalendar object *defines* a timezone which
is translated and passed to encode-time/tzset. It does not reference a
timezone defined elsewhere. The name of this timezone (std) is
irrelevant and so is the name of the daylight saving time (dst).

Ulf

-- 
Herzlichen Glückwunsch noch einmal, vergessen Sie Ihre Angaben,und dies 
für die Art und Weise von der öffentlichen Bekanntmachung.




      reply	other threads:[~2009-12-19 12:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-16 13:39 Timezone handling problem in icalendar.el/icalendar-import-* Christian
2009-12-16 14:18 ` Andreas Schwab
2009-12-16 18:38   ` Christian Lynbech
2009-12-16 20:40 ` Ulf Jasper
2009-12-17 10:09   ` Christian
2009-12-17 20:57     ` Ulf Jasper
2009-12-18  7:47       ` Christian
2009-12-18 19:38         ` Ulf Jasper
2009-12-18 22:40           ` Christian Lynbech
2009-12-19 12:16             ` Ulf Jasper [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=843a376twi.fsf@web.de \
    --to=ulf.jasper@web.de \
    --cc=christian.lynbech@tieto.com \
    --cc=christian@defun.dk \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).