Exemplo n.º 1
0
 def iget_date(self , time_index):
     """
     Returns the simulation date for element nr @time_index.
     """
     long_time = self._iget_sim_time(  time_index )
     ct = CTime(long_time)
     return ct.datetime()
Exemplo n.º 2
0
 def iget_restart_sim_time( self , index ):
     """
     Will locate restart block nr @index and return the true time
     as a datetime instance.
     """
     ct = CTime(cfunc.iget_restart_time( self , index ))
     return ct.datetime()
Exemplo n.º 3
0
 def iget_restart_sim_time(self, index):
     """
     Will locate restart block nr @index and return the true time
     as a datetime instance.
     """
     ct = CTime(cfunc.iget_restart_time(self, index))
     return ct.datetime()
Exemplo n.º 4
0
 def iget_date(self, time_index):
     """
     Returns the simulation date for element nr @time_index.
     """
     long_time = self._iget_sim_time(time_index)
     ct = CTime(long_time)
     return ct.datetime()
Exemplo n.º 5
0
    def iget_date(self, time_index):
        """
        Returns the simulation date for element nr @t
ime_index.
        """
        long_time = EclSum.cNamespace().iget_sim_time(self, time_index)
        ct = CTime(long_time)
        return ct.datetime()
Exemplo n.º 6
0
    def iget_date(self , time_index):
        """
        Returns the simulation date for element nr @t
ime_index.
        """
        long_time = EclSum.cNamespace().iget_sim_time( self , time_index )
        ct = CTime(long_time)
        return ct.datetime()
Exemplo n.º 7
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())
Exemplo n.º 8
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())
Exemplo n.º 9
0
 def getSimDate(self):
     ct = CTime(EclRestartHead.cNamespace().get_sim_time(self))
     return ct.datetime()
Exemplo n.º 10
0
 def getSimDate(self):
     ct = CTime( EclRestartHead.cNamespace().get_sim_time( self ) )
     return ct.datetime( )
Exemplo n.º 11
0
 def getSimDate(self):
     ct = CTime( self._get_sim_time( ) )
     return ct.datetime( )