itchyny / calendar.vim

A calendar application for Vim
MIT License
1.95k stars 72 forks source link

Daylight savings time #95

Closed framecurrent closed 6 years ago

framecurrent commented 9 years ago

Hi, Daylight savings time doesn't seem to display properly. All calendar posts after the switch from CEST to CET are shown as one hour later than they should be. Any workaround?

itchyny commented 9 years ago

How about specifying the time zone explicitly?

let g:calendar_time_zone = "+0100"
framecurrent commented 9 years ago

All calendar posts are then changed (both CEST and CET). Thus, the CET posts are OK, but the CEST posts are one hour early.

itchyny commented 9 years ago

Firstly I do not understand how do you deal with summer time. In my country there's no system of summer time so I don't have a experience.

framecurrent commented 9 years ago

You are quite lucky! The computers automatically change to and from DST every year. I'm not familiar with strftime(). How can I check it?

itchyny commented 9 years ago

Please check the result of :echo strftime('%z') in Vim.

framecurrent commented 9 years ago

OK. It gives +0200, which is correct for the CEST time zone.

itchyny commented 9 years ago

There are two timezones here; the timezone of your computer and that of the calendar. The calendars have their own time zones and you can confirm that configuration at www.google.com/calendar; Calendar settings in the dropdown which appears when you click the calendars on the left hand side. The calendar.vim converts the time stored in the calendars suitable for your computer timezone. Otherwise the events in calendars in UTC would not be displayed at the correct time in my PC; UTC+9:00. If your computer is in CEST, the events in CET calendar will be displayed an hour earlier than the time of the events; but that's coincident isn't it? The events while your computer is in CEST will be displayed one hour later after your computer switches back to CET.

framecurrent commented 9 years ago

OK. A bit complicated then. You are correct about the times. The google calendar settings are the same (CEST, UTC+02:00), but any posting in the calendar after the DST switch (end of October) is displayed with the correct time already now (i.e. a meeting at 08:00 on November 10 will be dispalyed in the calendar as 08:00, and not as 09:00). I guess that after the DST switch, the computer will be set to CET and all postings in calendar.vim after the DST switch will be displayed correctly, whereas the older postings will be off by one hour. It would of course be very handy if the calendar could do the same as google calendar, and display both times correctly without the confusion.

itchyny commented 9 years ago

OK, I understand. What you need might be pretty complicated... In that example, that meeting starts at 8:00 in CEST so it'll be displayed at 9:00 after the DST switch. So, how can calendar.vim detect the summer time system? There are some countries world wide which adopts the DST system. The result of strftime('%z') does not help; there are countries in UTC+02:00 all year, you know. I have no choice but to add an option in calendar.vim to support DST...

framecurrent commented 9 years ago

Right. Would be great if you could. It's a really nice plugin, and we are quite a few with the DST situation.

itchyny commented 6 years ago

Sorry but I'm closing this issue, it's hard to implement.