diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt index cbaf97ef..2b7a1b73 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt @@ -115,6 +115,7 @@ isdir isfile isinstance isnumeric +isoformat Isr issubclass iterdir @@ -246,6 +247,7 @@ testbuild testimpl textwrap timebase +timespec toctree todo toolchain diff --git a/src/fprime/common/models/serialize/time_type.py b/src/fprime/common/models/serialize/time_type.py index 53baa6a4..7dbff117 100644 --- a/src/fprime/common/models/serialize/time_type.py +++ b/src/fprime/common/models/serialize/time_type.py @@ -289,7 +289,10 @@ def to_readable(self, time_zone=None): # If we could convert to a valid datetime, use that, otherwise, format if dt: - return dt.strftime("%Y-%m-%d %H:%M:%S%z") + # datetime.isoformat() returns time string with microsecond + # precision. + # This line can be changed for other precisions or needs. + return dt.isoformat(timespec="microseconds") return "%s: %d.%06ds, context=%d" % ( TimeBase(self.__timeBase.val).name, self.__secs.val, diff --git a/src/fprime/common/models/serialize/type_base.py b/src/fprime/common/models/serialize/type_base.py index ad5394cc..30861733 100644 --- a/src/fprime/common/models/serialize/type_base.py +++ b/src/fprime/common/models/serialize/type_base.py @@ -4,6 +4,7 @@ @author: reder Replaced type base class with decorators """ + import abc from .type_exceptions import AbstractMethodException