I am getting my calendar events by a caldav library written in Python. It all looks good when I manually input events that are for a whole day. On the other hand when I input an event with a certain time span into my calendar and get those via my python script it has the wrong DTSTART attribute.
I will give an example: I input an event on the 08/07/2020 with the time 10:00 until 11:00. When I call my script and get this event every attribute is correct except for the datetime attributes which curiously always show 25/10/1970 as the date (dtstart, dtend, created, last modified). The time variable is also wrong, being 02 am until 03 am most of the time.
Does anyone have an idea why this happens?
Thank you very much.
Check the source code of the event by exporting it to a vcf file. You will see that the structure of an event looks like this:
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
As you can see the file contains multiple DTSTART attributes and you most likely grepping the wrong one. Only the one within the VEVENT block will give you the correct start and end time of the event
Curiously I didn’t see the first DTSTART when I printed out the event data. But after getting the substring between BEGIN:VEVENT and END:VEVENT everything worked out perfectly. Thank you very much!
Would you mind sharing some example code?