def testParseToTime(self):
     timeString = "1999-12-03 12:34:35.123"
     date = parseToTime(timeString)
     self.assertEquals((1999,12,3,12,34,35,123000), (date.year,date.month,date.day, date.hour, date.minute, date.second, date.microsecond))
     
     date = parseToTime("2006-08-04 10:40:50.644")
     self.assertEquals((2006,8,4,10,40,50,644000), (date.year,date.month,date.day, date.hour, date.minute, date.second, date.microsecond))
示例#2
0
    def testParseToTime(self):
        timeString = "1999-12-03 12:34:35.123"
        date = parseToTime(timeString)
        self.assertEqual((1999, 12, 3, 12, 34, 35, 123000),
                         (date.year, date.month, date.day, date.hour,
                          date.minute, date.second, date.microsecond))

        date = parseToTime("2006-08-04 10:40:50.644")
        self.assertEqual((2006, 8, 4, 10, 40, 50, 644000),
                         (date.year, date.month, date.day, date.hour,
                          date.minute, date.second, date.microsecond))
示例#3
0
 def testParseToTimeDiff(self):
     date1 = parseToTime("1999-12-03 12:34:35.123")
     date2 = parseToTime("1999-12-03 12:34:36.423")
     delta = date2 - date1
     self.assertEqual(1.3, delta.seconds + delta.microseconds / 1000000.0)
 def testParseToTimeDiff(self):
     date1 = parseToTime("1999-12-03 12:34:35.123")
     date2 = parseToTime("1999-12-03 12:34:36.423")
     delta = date2 - date1
     self.assertEquals(1.3, delta.seconds + delta.microseconds/1000000.0)