diff --git a/bin/peas_shell b/bin/peas_shell index e3b4c3d19..27f7bbc81 100755 --- a/bin/peas_shell +++ b/bin/peas_shell @@ -6,6 +6,7 @@ import os import readline import sys +from pytz import utc from astropy.utils import console from threading import Timer from pprint import pprint @@ -75,9 +76,12 @@ class PanSensorShell(cmd.Cmd): print("{}:".format(device.upper())) pprint(rec) print_info('*' * 80) + + # Display the age in seconds of the record if isinstance(rec.get('date'), datetime.datetime): - now = current_time(datetime=True) - age = (now - rec['date']).total_seconds() + now = current_time(datetime=True).astimezone(utc) + record_date = rec['date'].astimezone(utc) + age = (now - record_date).total_seconds() if age < 120: print_info('{:.1f} seconds old'.format(age)) else: