Date mapper time zone adjustment

Arto - July 1, 2009 - 02:21
Project:Feed Element Mapper
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Issue tags:date
Description

When a feed has non-UTC datetimes (e.g. "2009-03-24T16:03:00+01:00"), the Date mapper is currently adjusting these datetimes in the wrong direction based on the time zone offset given in the feed element. The attached single-line patch fixes this issue.

#1

Arto - July 1, 2009 - 02:23
AttachmentSize
506792_date_mapper_tz.patch 379 bytes

#2

Arto - July 1, 2009 - 02:29

To clarify the logic: if a datetime has, say, a TZ offset of UTC+2, then adjusting it by +2h (as mappers/feedapi_mapper_date.inc currently does) doesn't reset it back to UTC but rather makes UTC+4, which is clearly incorrect.

Thus, the adjustment must actually be performed as the opposite of the TZ sign; that is, in the case above the date must be adjusted by -2h. The attached patch, in my previous comment, takes care of this.

#3

Arto - July 17, 2009 - 13:37

Guys, any chance of getting this one-line fix committed, please? We're having to repeatedly patch this downstream when we import new revisions of Feed Element Mapper.

#4

alex_b - July 17, 2009 - 13:45
Status:reviewed & tested by the community» fixed

Sorry for delay. Committed to 1.x and 2.x. This is part of the Beta 12 release: http://drupal.org/node/522420

Thank you.

#5

System Message - July 31, 2009 - 13:50
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.