示例#1
0
文件: test_ctime.py 项目: akva2/ert
    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())
示例#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())
示例#3
0
文件: ecl_rft.py 项目: agchitu/ert
 def getDate(self):
     """
     The date when this RFT/PLT/... was recorded. 
     """
     ct = CTime(self._get_date( ))
     return ct.date()
示例#4
0
文件: ecl_rft.py 项目: danielfmva/ert
 def date(self):
     """
     The date when this RFT/PLT/... was recorded.
     """
     ct = CTime(cfunc_rft.get_date(self))
     return ct.date()
示例#5
0
 def date(self):
     """
     The date when this RFT/PLT/... was recorded.
     """
     ct = CTime(cfunc_rft.get_date( self ))
     return ct.date()
示例#6
0
 def getDate(self):
     """
     The date when this RFT/PLT/... was recorded. 
     """
     ct = CTime(self._get_date())
     return ct.date()