MartinThoma / ics-parser

Automatically exported from code.google.com/p/ics-parser
47 stars 28 forks source link

You should use gmmktime for Google Calendar ICS files #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
• What steps will reproduce the problem?
1. Parse a Google Calendar ICS file. Google uses only GMT to avoid conflicts 
with daylight saving times  
2. Use the function iCalDateToUnixTimestamp and it will return a bad timestamp 
if your location is not UTC / GMT. 

• What is the expected output? What do you see instead?
For example : an event starting 2015-01-20 17:00:00 GMT will be timestamped 
2015-01-20 16:00:00 GMT if you are located in Paris and your server configured 
like that. 

• What version of the product are you using? On what operating system?
Current - OSX 10.9.5 - MAMP Latest

• Please provide any additional information below.
My solution : use gmmktime instead of mktime in the iCalDateToUnixTimestamp 
function.

I hope I am clear... :)
And this helps some people.

Thxxxxxx for your useful class.

Regards

Julien

Original issue reported on code.google.com by julien.f...@gmail.com on 20 Jan 2015 at 3:10