def parse_transition_time(transition_time):
  """Parses an int, float, or Zulu time. Returns a float timestamp or None."""
  if isinstance(transition_time, (int, float)):
    return float(transition_time)
  return zulu.parse_zulu_ts(transition_time)
Beispiel #2
0
def parse_transition_time(transition_time):
    """Parses an int, float, or Zulu time. Returns a float timestamp or None."""
    if isinstance(transition_time, (int, float)):
        return float(transition_time)
    return zulu.parse_zulu_ts(transition_time)
Beispiel #3
0
 def testInvalidParse(self):
   timestring = '2015-06-11T23:YOLO:17:26.5Z'
   zuluparse = zulu.parse_zulu_ts(timestring)
   self.assertIsNone(zuluparse)
Beispiel #4
0
 def _assert_parses_to(self, timestring, utc_ts_equivalent):
   zuluparse = zulu.parse_zulu_ts(timestring)
   self.assertIsInstance(zuluparse, float)
   self.assertEqual(zuluparse, utc_ts_equivalent)
Beispiel #5
0
 def testInvalidParse(self):
     timestring = '2015-06-11T23:YOLO:17:26.5Z'
     zuluparse = zulu.parse_zulu_ts(timestring)
     self.assertIsNone(zuluparse)
Beispiel #6
0
 def _assert_parses_to(self, timestring, utc_ts_equivalent):
     zuluparse = zulu.parse_zulu_ts(timestring)
     self.assertIsInstance(zuluparse, float)
     self.assertEqual(zuluparse, utc_ts_equivalent)