diff --git a/circuitpython/code/cameteo.py b/circuitpython/code/cameteo.py index 3921e30..f91df6f 100644 --- a/circuitpython/code/cameteo.py +++ b/circuitpython/code/cameteo.py @@ -362,13 +362,10 @@ class GPSData(Data): if self._enable: self._gps_current_fix = int(time.monotonic()) - self.data['time'] = TIME_FORMAT.format( - self._gps.timestamp_utc.tm_year, - self._gps.timestamp_utc.tm_mon, - self._gps.timestamp_utc.tm_mday, - self._gps.timestamp_utc.tm_hour, - self._gps.timestamp_utc.tm_min, - self._gps.timestamp_utc.tm_sec) + if self._gps.timestamp_utc is not None: + self.data['time'] = TIME_FORMAT.format(*self._gps.timestamp_utc[0:6]) + else: + self.data['time'] = TIME_FORMAT.format(2018, 9, 10, 10, 0, 0) if self._gps.has_fix: self._gps_last_fix = self._gps_current_fix self.data['lat'] = self._gps.latitude