Fix: set microseconds to 0 when parsing timestamp
authorAntoine Busque <abusque@efficios.com>
Mon, 14 Mar 2016 19:43:54 +0000 (15:43 -0400)
committerAntoine Busque <abusque@efficios.com>
Mon, 14 Mar 2016 19:43:54 +0000 (15:43 -0400)
Signed-off-by: Antoine Busque <abusque@efficios.com>
lttnganalyses/common/parse_utils.py

index 5f92cb884d06c8110147b206999d27965d7b7b6b..be1c6e79c15b21bf9985868d52cca7fdef609c38 100644 (file)
@@ -310,6 +310,9 @@ def _parse_date_timestamp(date):
     date_time = datetime.datetime.fromtimestamp(
         timestamp_ns / NSEC_PER_SEC
     )
+    # Set the microseconds to 0 because values < 1 second are covered
+    # by the nsec value.
+    date_time = date_time.replace(microsecond=0)
     nsec = timestamp_ns % NSEC_PER_SEC
 
     return date_time, nsec
This page took 0.024563 seconds and 5 git commands to generate.