timrwood/moment — Issue #139: Timezone offsets flipped?
Author: dandrinkard
Created: 2012-01-21 22:38:19+00:00
State: open

I'm pretty sure I must be doing something wrong here. it __appears__ that parsing `2012-01-21T17:08:01-05:00` (EST) with or without the pattern `YYYY-MM-DDTHH:mm:ssZ` is subtracting 5 hours to get to UTC, rather than adding. As a result, my times when written back with format() are 10 hours behind. I get the expected result by flipping the comparison at line 301:

// reverse offsets
if (a[0] === '+') {
timezoneHours = -timezoneHours;
timezoneMinutes = -timezoneMinutes;
}

Surely this isn't right, am I parsing incorrectly?