How to get the Unixtime of an event?
Bastian Seeleib
bastian at seeleib.net
Sun Aug 14 13:45:42 PDT 2016
Using icalcomponent_get_dtstart() generates the same incorrect unixtime.
Am 14.08.16 um 22:31 schrieb Ken Murchison:
> Try using icalcomponent_get_dtstart(). I believe it properly handles
> the timezone.
>
>
> On 8/14/16 4:15 PM, Bastian Seeleib wrote:
>> Hi all,
>>
>> i'm trying to get the unixtime of an event and having trouble with
>> it, could someone help me?
>> Using the follwing function calls, i'm getting 1471941000 which is 2
>> hours later than expected.
>>
>> icalproperty *pt = icalcomponent_get_first_property(comp,
>> ICAL_DTSTART_PROPERTY);
>> struct icaltimetype t = icalproperty_get_dtstart(pt);
>> printf("%ld", icaltime_as_timet(t));
>>
>> The dates are defined as following:
>>
>> DTSTART;TZID="Central Europe":20160823T083000
>> DTEND;TZID="Central Europe":20160823T103000
>>
>> The VTIMEZINE is set to:
>>
>> BEGIN:VTIMEZONE
>> TZID:Central Europe
>> BEGIN:STANDARD
>> DTSTART:19501029T020000
>> TZOFFSETFROM:+0200
>> TZOFFSETTO:+0100
>> RRULE:FREQ=YEARLY;BYMINUTE=0;BYHOUR=2;BYDAY=-1SU;BYMONTH=10
>> END:STANDARD
>> BEGIN:DAYLIGHT
>> DTSTART:19500326T020000
>> TZOFFSETFROM:+0100
>> TZOFFSETTO:+0200
>> RRULE:FREQ=YEARLY;BYMINUTE=0;BYHOUR=2;BYDAY=-1SU;BYMONTH=3
>> END:DAYLIGHT
>> END:VTIMEZONE
>>
>> To me it seems that the definition of VTIMEZONE is ignored.
>>
>>
>> _______________________________________________
>> libical-devel mailing list
>> libical-devel at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/libical-devel
>
>
More information about the libical-devel
mailing list