emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Timezone/Encoding issues when exporting as ics and importing to Google Calendar
@ 2011-06-07 12:32 Tassilo Horn
  2011-06-07 13:48 ` Nick Dokos
  0 siblings, 1 reply; 6+ messages in thread
From: Tassilo Horn @ 2011-06-07 12:32 UTC (permalink / raw)
  To: emacs-orgmode

Hi all,

I export all my org-files as icalendar files, push them to some
webserver from which google calendar imports them.  Basically, that
works pretty good except for two things:

1. Encoding: All Umlauts and other non-ASCII chars show up as boxes in
   google calendar.  When visiting some exported ics file and doing M-x
   describe-coding-system, I get utf-8-unix for those files.  Doesn't
   google calendar support UTF-8?  And if so, is there a way to export
   as latin1 if that is supported by google?

2. Timezone: I live in Germany and thus all my timestamps are CEST.  The
   exported ics file properly declare X-WR-TIMEZONE:CEST.  However,
   since we also have DST, in summer all appointments show up 2 hours
   late, and in winter my appointments show up 1 hour late.  Is there
   anything I can do about it?  The google calendar settings have CEST
   as timezone...

Thanks for any hints!
Tassilo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Timezone/Encoding issues when exporting as ics and importing to Google Calendar
  2011-06-07 12:32 Timezone/Encoding issues when exporting as ics and importing to Google Calendar Tassilo Horn
@ 2011-06-07 13:48 ` Nick Dokos
  2011-06-07 14:58   ` Tassilo Horn
  0 siblings, 1 reply; 6+ messages in thread
From: Nick Dokos @ 2011-06-07 13:48 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: nicholas.dokos, emacs-orgmode

Tassilo Horn <tassilo@member.fsf.org> wrote:

> Hi all,
> 
> I export all my org-files as icalendar files, push them to some
> webserver from which google calendar imports them.  Basically, that
> works pretty good except for two things:
> 
> 1. Encoding: All Umlauts and other non-ASCII chars show up as boxes in
>    google calendar.  When visiting some exported ics file and doing M-x
>    describe-coding-system, I get utf-8-unix for those files.  Doesn't
>    google calendar support UTF-8?  And if so, is there a way to export
>    as latin1 if that is supported by google?
> 
> 2. Timezone: I live in Germany and thus all my timestamps are CEST.  The
>    exported ics file properly declare X-WR-TIMEZONE:CEST.  However,
>    since we also have DST, in summer all appointments show up 2 hours
>    late, and in winter my appointments show up 1 hour late.  Is there
>    anything I can do about it?  The google calendar settings have CEST
>    as timezone...
> 

I don't know if this is the problem you are running into, but 
icalendar--convert-tz-offset is buggy as-is: it looks as if
additional work was planned for it, but it never got done.
In particular, it assumes there is an RRULE in the icalendar file
and does not translate timezones otherwise.

Reading your mail again, I guess you are having problems in the
other direction, but IME, if there is a bug somewhere, there is
at least one more going the other way :-) 

Nick

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Timezone/Encoding issues when exporting as ics and importing to Google Calendar
  2011-06-07 13:48 ` Nick Dokos
@ 2011-06-07 14:58   ` Tassilo Horn
  2012-03-15  7:29     ` Kevin Brubeck Unhammer
  0 siblings, 1 reply; 6+ messages in thread
From: Tassilo Horn @ 2011-06-07 14:58 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

Nick Dokos <nicholas.dokos@hp.com> writes:

Hi Nick,

>> 2. Timezone: I live in Germany and thus all my timestamps are CEST.  The
>>    exported ics file properly declare X-WR-TIMEZONE:CEST.  However,
>>    since we also have DST, in summer all appointments show up 2 hours
>>    late, and in winter my appointments show up 1 hour late.  Is there
>>    anything I can do about it?  The google calendar settings have CEST
>>    as timezone...
>> 
>
> I don't know if this is the problem you are running into, but
> icalendar--convert-tz-offset is buggy as-is: it looks as if additional
> work was planned for it, but it never got done.  In particular, it
> assumes there is an RRULE in the icalendar file and does not translate
> timezones otherwise.

I don't know the iCalendar spec so I don't know what an RRULE is.  But
as far as I can see, `icalendar--convert-tz-offset' is used while
converting an ics file to the diary format.

> Reading your mail again, I guess you are having problems in the
> other direction,

Right. ;-)

> but IME, if there is a bug somewhere, there is at least one more going
> the other way :-)

Probably.  Looking at the ical spec, this X-WR-TIMEZONE property is an
optional extension nobody has to obey.  Org exports the times like

  DTSTART:20110317T091500

which means "local time".  So probably the google server has UTC as
local time, my preferences say I want to use Berlin-time, so all events
get two hours added in summer.

Now I've tried to explicitly set the timezone information using

    org-icalendar-timezone "Europe/Berlin"
    org-icalendar-date-time-format ";TZID=%Z:%Y%m%dT%H%M%S"

and now the events are like

    DTSTART;TZID=EUROPE/BERLIN:20110322T140000
    DTEND;TZID=EUROPE/BERLIN:20110322T160000

However, that doesn't change anything in google calendar...

Finally, I've set GMT+0 as my current timezone in google calendar, and
now my appointments are shown correctly.  Ok, that's not really a
solution but only a workaround...

Oh, there's another possibility; setting

    org-icalendar-date-time-format ":%Y%m%dT%H%M%SZ"

which then seems to correctly recalculate the local times in my org
files to GMT.  So for an entry that starts at 14:30 and ends an 16:30,
that's what exported.

  DTSTART:20100518T123000Z
  DTEND:20100518T143000Z

Looks good, I'd say.  But when importing that to google calendar, it
shows that entry starting at 16:30 and ending at 18:30 Berlin-time.  Now
what's that?!?

Oh, it seems to be some caching issue.  Although the new ics file is on
the server now, it seems that a reload of google calendar doesn't
reimport all imported calendars.  So I'll wait a bit and report back
what methods work (explicit TZIDs and/or export as UTC).

Bye,
Tassilo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Timezone/Encoding issues when exporting as ics and importing to Google Calendar
  2011-06-07 14:58   ` Tassilo Horn
@ 2012-03-15  7:29     ` Kevin Brubeck Unhammer
  2012-03-20 11:41       ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: Kevin Brubeck Unhammer @ 2012-03-15  7:29 UTC (permalink / raw)
  To: emacs-orgmode

Tassilo Horn <tassilo@member.fsf.org> writes:

> Nick Dokos <nicholas.dokos@hp.com> writes:
>
> Hi Nick,
>
>>> 2. Timezone: I live in Germany and thus all my timestamps are CEST.  The
>>>    exported ics file properly declare X-WR-TIMEZONE:CEST.  However,
>>>    since we also have DST, in summer all appointments show up 2 hours
>>>    late, and in winter my appointments show up 1 hour late.  Is there
>>>    anything I can do about it?  The google calendar settings have CEST
>>>    as timezone...
>>> 
>>
>> I don't know if this is the problem you are running into, but
>> icalendar--convert-tz-offset is buggy as-is: it looks as if additional
>> work was planned for it, but it never got done.  In particular, it
>> assumes there is an RRULE in the icalendar file and does not translate
>> timezones otherwise.
>
> I don't know the iCalendar spec so I don't know what an RRULE is.  But
> as far as I can see, `icalendar--convert-tz-offset' is used while
> converting an ics file to the diary format.
>
>> Reading your mail again, I guess you are having problems in the
>> other direction,
>
> Right. ;-)
>
>> but IME, if there is a bug somewhere, there is at least one more going
>> the other way :-)
>
> Probably.  Looking at the ical spec, this X-WR-TIMEZONE property is an
> optional extension nobody has to obey.  Org exports the times like
>
>   DTSTART:20110317T091500
>
> which means "local time".  So probably the google server has UTC as
> local time, my preferences say I want to use Berlin-time, so all events
> get two hours added in summer.
>
> Now I've tried to explicitly set the timezone information using
>
>     org-icalendar-timezone "Europe/Berlin"
>     org-icalendar-date-time-format ";TZID=%Z:%Y%m%dT%H%M%S"
>
> and now the events are like
>
>     DTSTART;TZID=EUROPE/BERLIN:20110322T140000
>     DTEND;TZID=EUROPE/BERLIN:20110322T160000
>
> However, that doesn't change anything in google calendar...
>
> Finally, I've set GMT+0 as my current timezone in google calendar, and
> now my appointments are shown correctly.  Ok, that's not really a
> solution but only a workaround...
>
> Oh, there's another possibility; setting
>
>     org-icalendar-date-time-format ":%Y%m%dT%H%M%SZ"
>
> which then seems to correctly recalculate the local times in my org
> files to GMT.  So for an entry that starts at 14:30 and ends an 16:30,
> that's what exported.
>
>   DTSTART:20100518T123000Z
>   DTEND:20100518T143000Z
>
> Looks good, I'd say.  But when importing that to google calendar, it
> shows that entry starting at 16:30 and ending at 18:30 Berlin-time.  Now
> what's that?!?
>
> Oh, it seems to be some caching issue.  Although the new ics file is on
> the server now, it seems that a reload of google calendar doesn't
> reimport all imported calendars.  So I'll wait a bit and report back
> what methods work (explicit TZIDs and/or export as UTC).

Did you ever find out what methods worked best? I just bumped into the
same problem with 30boxes, which shows

DTSTART:20120228T180000Z as 19:00 (should be 18:00)
and
DTSTART:20120228T180000 as 00:00 the day after

(the web calender is set to GMT+1, the exported ics shows
X-WR-TIMEZONE:CET)


I guess I'll have to upgrade my org-mode version (6.33x) to get
org-icalendar-date-time-format?


best regards,
Kevin Brubeck Unhammer

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Timezone/Encoding issues when exporting as ics and importing to Google Calendar
  2012-03-15  7:29     ` Kevin Brubeck Unhammer
@ 2012-03-20 11:41       ` Bastien
  2012-03-20 12:33         ` Kevin Brubeck Unhammer
  0 siblings, 1 reply; 6+ messages in thread
From: Bastien @ 2012-03-20 11:41 UTC (permalink / raw)
  To: Kevin Brubeck Unhammer; +Cc: emacs-orgmode

Hi Kevin,

Kevin Brubeck Unhammer <unhammer@fsfe.org> writes:

> I guess I'll have to upgrade my org-mode version (6.33x) to get
> org-icalendar-date-time-format?

Not sure this will fix your problem, but yes, 6.33x is kinda 
prehistoric now.

Best,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Timezone/Encoding issues when exporting as ics and importing to Google Calendar
  2012-03-20 11:41       ` Bastien
@ 2012-03-20 12:33         ` Kevin Brubeck Unhammer
  0 siblings, 0 replies; 6+ messages in thread
From: Kevin Brubeck Unhammer @ 2012-03-20 12:33 UTC (permalink / raw)
  To: emacs-orgmode

Bastien <bzg@gnu.org> writes:

> Hi Kevin,
>
> Kevin Brubeck Unhammer <unhammer@fsfe.org> writes:
>
>> I guess I'll have to upgrade my org-mode version (6.33x) to get
>> org-icalendar-date-time-format?
>
> Not sure this will fix your problem, but yes, 6.33x is kinda 
> prehistoric now.
>
> Best,

I ended up making a function to turn local time into UTC
(http://paste.pocoo.org/raw/568445/ , probably could've been a lot
simpler, but I don't really understand all the various time formats
floating around), seems to work so far. And of course had to redefine
org-ical-ts-to-string to take org-icalendar-date-time-format
(":%Y%m%dT%H%M%SZ") into account, and use time-to-utc before formatting
(http://paste.pocoo.org/raw/568448/). 

It works :-/


-Kevin

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-03-20 12:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-07 12:32 Timezone/Encoding issues when exporting as ics and importing to Google Calendar Tassilo Horn
2011-06-07 13:48 ` Nick Dokos
2011-06-07 14:58   ` Tassilo Horn
2012-03-15  7:29     ` Kevin Brubeck Unhammer
2012-03-20 11:41       ` Bastien
2012-03-20 12:33         ` Kevin Brubeck Unhammer

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).