-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- igc/reader: add "datetime" and "datetime_local" to fix_records to (#…
…307) * - igc/reader: add "datetime" and "datetime_local" to fix_records to deal with UTC and local time correctly. Please read "How to read an IGC file" for a detailed explanation. * Added missing timezone.py * Fix datetime.UTC, which is only available in python 3.11
- Loading branch information
Showing
7 changed files
with
58 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import datetime | ||
|
||
|
||
class TimeZoneFix(datetime.tzinfo): | ||
|
||
def __init__(self, fix): | ||
self.fix = fix | ||
|
||
def utcoffset(self, dt): | ||
return datetime.timedelta(hours=self.fix) | ||
|
||
def dst(self, dt): | ||
return datetime.timedelta(0) | ||
|
||
def tzname(self, dt): | ||
return str(self.fix) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters