Skip to content

Commit ea58423

Browse files
committed
MAVExplorer: use timezone-aware UTC datetime
datetime.datetime.utcfromtimestamp() is deprecated. Replace with datetime.datetime.fromtimestamp(tbase, datetime.timezone.utc).
1 parent 0e2617c commit ea58423

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

MAVProxy/tools/MAVExplorer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1728,7 +1728,7 @@ def main_loop():
17281728
from dateutil.tz import tzlocal
17291729
localtimezone = tzlocal()
17301730
tbase = epoch_time(xlim[0])
1731-
tzofs = localtimezone.utcoffset(datetime.datetime.utcfromtimestamp(tbase)).total_seconds()
1731+
tzofs = localtimezone.utcoffset(datetime.datetime.fromtimestamp(tbase, datetime.timezone.utc)).total_seconds()
17321732
xlimits.xlim_low = epoch_time(xlim[0]) - tzofs
17331733
xlimits.xlim_high = epoch_time(xlim[1]) - tzofs
17341734

0 commit comments

Comments
 (0)