Fix iOS/MacOS Calendar incorrect time zone info

Modifies iCalendar (rfc5545) TZOFFSETFROM and TZOFFSETTO from +023017 to +0300.
Example:

BEGIN:VTIMEZONE
TZID:Europe/Moscow
BEGIN:STANDARD
TZOFFSETFROM:+023017
DTSTART:20010101T000000
TZNAME:GMT+3
TZOFFSETTO:+023017
END:STANDARD
END:VTIMEZONE

Script:

grep -rl '+023017' ~/.mycalendars | xargs -I {} sed -i -r 's/\+023017/+0300/; s/(SEQUENCE:)([0-9]+)/echo \1"$((\2+1))"/e; s/LAST-MODIFIED:.*/echo "LAST-MODIFIED:$(date +%Y%m%dT%H%M%SZ)"/e' {}

Related:

Tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *