Beispiel #1
0
    def test_conversion(self):
        t = CTime(0)

        self.assertEqual(t.value(), 0)
        self.assertEqual(t.ctime(), 0)
        self.assertEqual(t.time(), time.localtime(0))

        # These conversions depend on timezone
        utc = timezone('utc')
        local_timezone = timezone(CTime.timezone())

        localized_dt = local_timezone.localize(t.datetime())
        self.assertEqual(localized_dt.astimezone(utc), datetime(1970, 1, 1, 0, tzinfo=utc))

        localized_d = datetime(1970, 1, 1, 0, tzinfo=utc).astimezone(local_timezone)
        self.assertEqual(t.date(), localized_d.date())
Beispiel #2
0
    def test_conversion(self):
        t = CTime(0)

        self.assertEqual(t.value(), 0)
        self.assertEqual(t.ctime(), 0)
        self.assertEqual(t.time(), time.localtime(0))

        # These conversions depend on timezone
        utc = timezone('utc')
        local_timezone = timezone(CTime.timezone())

        localized_dt = local_timezone.localize(t.datetime())
        self.assertEqual(localized_dt.astimezone(utc),
                         datetime(1970, 1, 1, 0, tzinfo=utc))

        localized_d = datetime(1970, 1, 1, 0,
                               tzinfo=utc).astimezone(local_timezone)
        self.assertEqual(t.date(), localized_d.date())
Beispiel #3
0
 def getDate(self):
     """
     The date when this RFT/PLT/... was recorded. 
     """
     ct = CTime(self._get_date( ))
     return ct.date()
Beispiel #4
0
 def date(self):
     """
     The date when this RFT/PLT/... was recorded.
     """
     ct = CTime(cfunc_rft.get_date(self))
     return ct.date()
Beispiel #5
0
 def date(self):
     """
     The date when this RFT/PLT/... was recorded.
     """
     ct = CTime(cfunc_rft.get_date( self ))
     return ct.date()
Beispiel #6
0
 def getDate(self):
     """
     The date when this RFT/PLT/... was recorded. 
     """
     ct = CTime(self._get_date())
     return ct.date()