|
7 | 7 | import time |
8 | 8 | import logging |
9 | 9 |
|
10 | | -from datetime import datetime, timedelta |
| 10 | +from datetime import datetime, timedelta, timezone |
11 | 11 | from urllib.parse import urlparse |
12 | 12 | from io import BytesIO |
13 | 13 | from ftplib import FTP_TLS, FTP |
@@ -296,7 +296,7 @@ def download_nav(time: GPSTime, cache_dir, constellation: ConstellationId): |
296 | 296 | if constellation not in CONSTELLATION_NASA_CHAR: |
297 | 297 | return None |
298 | 298 | c = CONSTELLATION_NASA_CHAR[constellation] |
299 | | - if GPSTime.from_datetime(datetime.utcnow()) - time > SECS_IN_DAY: |
| 299 | + if GPSTime.from_datetime(datetime.now(timezone.utc)) - time > SECS_IN_DAY: |
300 | 300 | url_bases = ( |
301 | 301 | mirror_url(CDDIS_BASE_URL, '/gnss/data/daily/'), |
302 | 302 | ) |
@@ -339,9 +339,9 @@ def download_orbits_gps(time, cache_dir, ephem_types): |
339 | 339 | } |
340 | 340 |
|
341 | 341 | # Download filenames in order of quality. Final -> Rapid -> Ultra-Rapid(newest first) |
342 | | - if EphemerisType.FINAL_ORBIT in ephem_types and GPSTime.from_datetime(datetime.utcnow()) - time > 3 * SECS_IN_WEEK: |
| 342 | + if EphemerisType.FINAL_ORBIT in ephem_types and GPSTime.from_datetime(datetime.now(timezone.utc)) - time > 3 * SECS_IN_WEEK: |
343 | 343 | filenames.extend(ephem_strs[EphemerisType.FINAL_ORBIT]) |
344 | | - if EphemerisType.RAPID_ORBIT in ephem_types and GPSTime.from_datetime(datetime.utcnow()) - time > 3 * SECS_IN_DAY: |
| 344 | + if EphemerisType.RAPID_ORBIT in ephem_types and GPSTime.from_datetime(datetime.now(timezone.utc)) - time > 3 * SECS_IN_DAY: |
345 | 345 | filenames.extend(ephem_strs[EphemerisType.RAPID_ORBIT]) |
346 | 346 | if EphemerisType.ULTRA_RAPID_ORBIT in ephem_types: |
347 | 347 | filenames.extend(ephem_strs[EphemerisType.ULTRA_RAPID_ORBIT]) |
|
0 commit comments