mirror of
https://github.com/mnauw/git-remote-hg.git
synced 2026-01-21 13:42:04 +01:00
The current code miscalculates the time-zone offsets for time zones that don't have a full-hour offset and are located west of UTC (e.g. St. John's, Newfoundland). Basically it's caused because 33 // 10 == 3, but -33 // 10 != -3. Take the example of St. John's (-0330). The correct integer timezone should be 3.5 * 3600 (12600), however, since we are not checking for negative module arithmetic, instead of calculating the timezone for (-3, -30), we are doing it for (-4, 70), which would be OK... if we had hours of 100 minutes: -4 * 100 + 70 = -330 We could fix the code to use proper negative arithmetic (mod -100), but why bother with the extra complexity? Let's just use absolute numbers and fix the sign later. This fixes issue #48. Commit message written by Felipe Contreras. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>