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
#2
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.inccurrently 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
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
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
Automatically closed -- issue fixed for 2 weeks with no activity.