| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -182,9 +182,11 @@ def parse_date(string_date: Union[str, datetime]) -> Tuple[int, int]: | |||
| 182 | 182 | :note: Date can also be YYYY.MM.DD, MM/DD/YYYY and DD.MM.YYYY. | |
| 183 | 183 | """ | |
| 184 | 184 | if isinstance(string_date, datetime): | |
| 185 | - if string_date.tzinfo: | ||
| 185 | + if string_date.tzinfo and string_date.utcoffset(): | ||
| 186 | 186 | utcoffset = string_date.utcoffset() | |
| 187 | 187 | offset = -int(utcoffset.total_seconds()) if utcoffset else 0 | |
| 188 | + else: | ||
| 189 | + offset = 0 | ||
| 188 | 190 | return int(string_date.astimezone(utc).timestamp()), offset | |
| 189 | 191 | else: | |
| 190 | 192 | assert isinstance(string_date, str), f"string_date={string_date}, type={type(string_date)}" # for mypy | |
| Back | FazBrowse Home | New Git URL |
0 commit comments