Page MenuHomePhorge

Invalid VTIMEZONE definitions for negative offsets to UTC
Closed, ResolvedPublic2 Story Points

Description

As reported through the devel mailing list, libvacalendaring generates invalid timezone specifications specifically with TZOFFSETFROM and TZOFFSETTO for timezones with negative UTC offsets:

BEGIN:VTIMEZONE
TZID:America/New_York
X-MICROSOFT-CDO-TZID:10
BEGIN:STANDARD
DTSTART:20141102T060000
TZOFFSETFROM:-400
TZOFFSETTO:-500
TZNAME:EST
END:STANDARD
...
END:VTIMEZONE

The offset values should read -0400 and -0500 instead.
The reporter suggests this

for fixing the issue.

Test cases to be created:

$tz = new DateTimezone('America/New_York');
$event = array(
  'uid' => '12345',
  'summary' => 'test',
  'start' => new DateTime('20130703T143000', $tz),
  'end' => new DateTime('20130703T143000', $tz),
);

$ical = new libvcalendar();
$ics = $ical->export(array($event));

Expected result:

$ics contains TZOFFSETFROM:-0400 and TZOFFSETTO:-0500

Details

Ticket Type
Task

Event Timeline

bruederli claimed this task.
bruederli raised the priority of this task from to 60.
bruederli updated the task description. (Show Details)
bruederli added projects: Roundcube Kolab Plugins , Restricted Project.
bruederli changed Ticket Type from Task to Task.
bruederli edited projects, added Restricted Project; removed Restricted Project.
bruederli edited a custom field.
bruederli updated the task description. (Show Details)
bruederli subscribed.

Interesting:

printf("* %02d\n",  2);
printf("* %02d\n", -2);

results in

* 02
* -2

The sign character also contributes to the number of digits. This:

printf("* %+03d\n",  2);
printf("* %+03d\n", -2);

produces the expected result for the timezone specifications:

* +02
* -02
bruederli moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Jun 8 2015, 9:52 AM