msherry / ical2org

A fork of http://orgmode.org/worg/code/awk/ical2org.awk with some improvements.
53 stars 27 forks source link

timezone offsets not respected #4

Closed luca-ing closed 10 months ago

luca-ing commented 3 years ago

Observation: It appears as though all calendar entries are interpreted as being in my local timezone, even though that may not be the case.

Going by the documentation, it seems as though the script should do the right thing automagically seeing as the timestamps are given including timezones.

Expectation: ical2org correctly adjusts for local time, or else documents its limits more clearly.

Additional info:

`

$ timedatectl 

           Local time: Di 2021-05-04 08:27:01 CEST
       Universal time: Di 2021-05-04 06:27:01 UTC 
             RTC time: Di 2021-05-04 06:27:02     
            Time zone: Europe/Berlin (CEST, +0200)
System clock synchronized: no                         
          NTP service: inactive                   
      RTC in local TZ: no 

`

Example ICS entry:

The entry is given as 16:30 India time, which should be 13:00 my time, but it's not being converted

`

Discuss the work plan. Discuss the key points regarding the design and development of the course. (redacted)

** COMMENT original iCal entry

BEGIN:VEVENT DTSTART;TZID=Asia/Kolkata:20210506T163000 DTEND;TZID=Asia/Kolkata:20210506T173000 ORGANIZER;

(redacted)

RECURRENCE-ID;TZID=Asia/Kolkata:20210506T163000 CREATED:20210311T135650Z DESCRIPTION:Discuss the work plan. \nDiscuss the key points regarding the d esign and development of the course. \n\nDieser Termin enthält einen Videoa nruf.\nTeilnehmen: (redacted) LAST-MODIFIED:20210430T161511Z LOCATION: SEQUENCE:1 STATUS:CONFIRMED SUMMARY:(redacted summary) TRANSP:OPAQUE END:VEVENT

`

msherry commented 3 years ago

Yup, this is definitely an issue! It's something I've noticed as well. I'd love to fix it, but haven't really had time. If you (or anyone else!) wants to submit a PR to take a stab at it, I'd be happy to look it over. Otherwise, it's on my backlog of things I hope to get to one day.

viglioni commented 2 years ago

A quick workaround is to add manually the offset

e.g. I'm in Brazil and Amsterdam is 5 hours ahead of me, with this line the script works:

BEGIN {
  # ...
  tz_offsets["Europe/Amsterdam"] = 5
}

Maybe it is possible to write a better fix calculating with this logic but for a quick temp solution it worked for me

obs.: I'm using macOS

shindere commented 10 months ago

I would be very interested in this being fixed: I'm blind, did maintain two calendars so far (one on Google for work and my personal one under Org, including the first one but with more events) but now this is becoming just too cumbersome to be sustainable.

I work in a company with offices in Paris (where I am), Cambridge (UK) and Chennai (India).

All the events created by my colleagues in the UK or India are shown with wrong starting and ending times.

I'm sorry, I don't have the energy to dive into this but would be infinitely grateful to whoever would be willing to work on that.

punchagan commented 10 months ago

@shindere @msherry I've opened #15 that attempts to fix this using timezone offsets calculated using the date command.

shindere commented 10 months ago

Puneeth Chaganti (2024/01/09 09:24 -0800):

@shindere @msherry I've opened #15 that attempts to fix this using timezone offsets calculated using the date command.

That's an awesome fix, at least in terms of how well it works! Thank you so much!!

msherry commented 10 months ago

Much appreciated, thank you for helping out!