Esempio n. 1
0
 def testtimeFromString(self):
     dateTimeStr = "2011-12-21 16:45:08"
     self.assertEqual(
         datetime.datetime.strptime(
             dateTimeStr,
             DATE_TIME_SEPARATOR.join((DATE_FORMAT, TIME_FORMAT))),
         timeFromString(dateTimeStr))
Esempio n. 2
0
 def testtimeFromString(self):
     dateTimeStr = "2011-12-21 16:45:08"
     self.assertEqual(datetime.datetime.strptime(dateTimeStr,
                 DATE_TIME_SEPARATOR.join((DATE_FORMAT, TIME_FORMAT))),
                                          timeFromString(dateTimeStr))
Esempio n. 3
0
 def testtimeToStringNoTime(self):
     date0 = datetime.datetime.now().date()
     self.assertEqual(
         date0.strftime(DATE_TIME_SEPARATOR.join(
             (DATE_FORMAT, TIME_FORMAT))), timeToString(date0))
Esempio n. 4
0
 def testtimeToStringNoTime(self):
     date0 = datetime.datetime.now().date()
     self.assertEqual(date0.strftime(DATE_TIME_SEPARATOR.join(
                     (DATE_FORMAT, TIME_FORMAT))), timeToString(date0))