pombreda / gcalcli

Automatically exported from code.google.com/p/gcalcli
0 stars 0 forks source link

Time is coming out wrong #70

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run gcalcli agenda
2. The time of one event that is supposed to be at 8:00pm tonight is listed as 
12:00am tomorrow

What is the expected output? What do you see instead?
I expected to see the event at 8:00pm tonight.

What version of the product are you using? On what operating system?
gcalcli v2.1 (Eric Davis) on Ubuntu Natty

Please provide any additional information below.

All the timezone stuff should  be correct. Every other event is correct.

Original issue reported on code.google.com by joemburg...@gmail.com on 23 Aug 2011 at 11:30

GoogleCodeExporter commented 9 years ago
You mention all the other events show the correct time.  If you look at the 
details of the event showing at 8pm... was it configured for a different 
timezone (under event details)?  Trying to understand why this one event is 
different from all others.

Original comment by eda...@insanum.com on 24 Aug 2011 at 1:46

GoogleCodeExporter commented 9 years ago
I have the same problem.  All events are shown as being 4 hours ahead of what 
they should be.  I am in the Eastern time zone.  Running "TZ=Eastern ./gcalcli 
calw" doesn't help.

Original comment by dstah...@gmail.com on 9 Sep 2011 at 3:57

GoogleCodeExporter commented 9 years ago
On closer look, some of the events are right and some are wrong.  There is no 
mention of timezone in the details for any of the events.

Original comment by dstah...@gmail.com on 9 Sep 2011 at 4:04

GoogleCodeExporter commented 9 years ago
Could you duplicate the issue in a public calendar that you can share and I 
could test against?

Original comment by eda...@insanum.com on 9 Sep 2011 at 4:34

GoogleCodeExporter commented 9 years ago
The issue shows up for the events in the calendar available from: 
http://www.hackpittsburgh.org/

In particular, today's event "spark gap speakers" is at 7pm Eastern but shown 
in gcalcli as 11pm.

Original comment by dstah...@gmail.com on 9 Sep 2011 at 5:04

GoogleCodeExporter commented 9 years ago
Going to the calendar setting, and setting the timezone appropriately fixed it 
for me... by default it appears to export the times in GMT or UTC, which is why 
the times are offset.

Original comment by peter.j....@gmail.com on 3 Oct 2011 at 12:16

GoogleCodeExporter commented 9 years ago
Hmm... if I'm looking in the right place, then my calendar setting seems to 
already be set to the proper time zone, "(GMT-5) Eastern" (although with the 
current state of daylight saving time it should be GMT-4).

It appears that the issue is that Google sends some events in local time and 
some events in UTC time, and gcalcli doesn't convert to local time.  I fixed it 
by adding the following after the times are parsed on line 796 (of version 2.1):

                event.s = event.s.astimezone(tzlocal())
                event.e = event.e.astimezone(tzlocal())

This seems to work, but I don't know enough about the code to know if changes 
also need to be made elsewhere.

Original comment by dstah...@gmail.com on 3 Oct 2011 at 2:38

GoogleCodeExporter commented 9 years ago
I can confirm that adding:
                event.s = event.s.astimezone(tzlocal())
                event.e = event.e.astimezone(tzlocal())
Fixes the problem for me as well.

Original comment by mathias....@gmail.com on 2 Nov 2011 at 10:39

GoogleCodeExporter commented 9 years ago
gcalcli moved to github: https://github.com/insanum/gcalcli

Please submit this issue there if your still having problems. Verify on the 
master branch.  Note that I'm pretty sure I fixed this...

Original comment by eda...@insanum.com on 15 May 2012 at 2:52