예제 #1
0
    def test_nl_dates(self):
        date = DateParser().parse('11 augustus 2014')
        self.assertEqual(datetime(2014, 8, 11).date(), date.date())

        date = DateParser().parse('14 januari 2014')
        self.assertEqual(datetime(2014, 1, 14).date(), date.date())

        date = DateParser().parse('vr jan 24, 2014 12:49')
        self.assertEqual(datetime(2014, 1, 24, 12, 49), date)
예제 #2
0
    def test_nl_dates(self):
        date = DateParser().parse('11 augustus 2014')
        self.assertEqual(datetime(2014, 8, 11).date(), date.date())

        date = DateParser().parse('14 januari 2014')
        self.assertEqual(datetime(2014, 1, 14).date(), date.date())

        date = DateParser().parse('vr jan 24, 2014 12:49')
        self.assertEqual(datetime(2014, 1, 24, 12, 49), date)
예제 #3
0
 def test_parse_only_hours_date(self):
     today = datetime.utcnow().replace(hour=0,
                                       minute=0,
                                       second=0,
                                       microsecond=0)
     result = DateParser().parse('10:04am EDT')
     self.assertEqual(today.date(), result.date())
예제 #4
0
 def test_parse_only_hours_date(self):
     today = datetime.utcnow().replace(hour=0, minute=0, second=0, microsecond=0)
     result = DateParser().parse('10:04am EDT')
     self.assertEqual(today.date(), result.date())