alistairmgreen / jsigc

A browser-based viewer for gliding flight recorder logs.
https://alistairmgreen.github.io/jsigc/
MIT License
25 stars 11 forks source link

Flight date not always correct #3

Closed alistairmgreen closed 9 years ago

alistairmgreen commented 9 years ago

Users located in the United States have reported that the flight date displayed is one day earlier than the actual date. This bug may be caused by the large difference between local time and UTC.

Example file: http://crosscountry.aero/flight/view/6074

alistairmgreen commented 9 years ago

At present the code assumes that the date given in the date header is UTC. This is correct according to the official IGC specification.

alistairmgreen commented 9 years ago

Reproduced: Date is correct if system clock is set to London time zone, but incorrect (for same IGC file) if system clock is set to US Pacific time zone.

It seems that the date is being read from the file as UTC, then implicitly converted to local time when it is displayed. If the time zone is behind UTC, then this conversion takes a few hours off and causes the date to become the day before.

alistairmgreen commented 9 years ago

Fixed by pull request #9.