Get date and time from PLC.

        :return: date and time as datetime
772301
def get_plc_datetime(self):
        
        type_ = c_int32
        buffer = (type_ * 9)()
        result = self.library.Cli_GetPlcDateTime(self.pointer, byref(buffer))
        check_error(result, context="client")

        return datetime(
            year = buffer[5] + 1900,
            month = buffer[4] + 1,
            day = buffer[3],
            hour = buffer[2],
            minute = buffer[1],
            second = buffer[0]
        )
1023748
def str_to_time(self):
        

        return datetime(*list(map(int, re.split(r'-|:|T', self.time))))
689169
def datetime(self):
        """"""
        return dt.datetime(
            self.year(), self.month(), self.day(),
            self.hour(), self.minute(), self.second(),
            int(self.millisecond() * 1e3))
170887
def getLTime():
    """"""

    _ltime = _time.localtime(_time.time())
    tlm_str = _time.strftime('%H:%M:%S (%d/%m/%Y)', _ltime)
    return tlm_str
944862
def get_iso_time(date_part, time_part):
    """
    str_date = datetime.datetime.strptime(
        date_part, '%m/%d/%Y').strftime('%Y-%m-%d')
    str_time = datetime.datetime.strptime(
        time_part, '%I:%M %p').strftime('%H:%M:%S')

    return str_date + "T" + str_time + "-7:00"
998429
def get_times(self):
        
        send_time = ctypes.c_int32()
        recv_time = ctypes.c_int32()
        result = self.library.Par_GetTimes(self.pointer, ctypes.byref(send_time),
                                   ctypes.byref(recv_time))
        check_error(result, "partner")
        return send_time, recv_time
948260
def date(self):
        """"""
        if self.commit_time:
            return datetime.utcfromtimestamp(self.commit_time)
        else:
            return datetime.now()
1013365
def datetime(self):
        ''
        index = self.data.index.remove_unused_levels()
        return pd.to_datetime(index.levels[0])
976488
def time_stamp():
    

    # Time constants
    fmt = '%Y-%m-%dT%H:%M:%S.%f'
    date = datetime.datetime
    date_delta = datetime.timedelta
    now = datetime.datetime.utcnow()

    return fmt, date, date_delta, now
649792
def date_to_datetime(d):
    
    if not isinstance(d, datetime):
        d = datetime.combine(d, datetime.min.time())
    return d
730651
def Timestamp():
    
    timestamp = ''
    try:
        timestamp = str(datetime.datetime.now())+' UTC'
    except Exception as e:  # pragma: no cover
        logger.error('Could not get current time ' + str(e))
    return timestamp
1312517
def get_date_info(value):
    
    fmt = _get_date_format(value)
    dt_value = _datetime_obj_factory(value, fmt)
    return dt_value, fmt
77858
def QA_util_get_trade_datetime(dt=datetime.datetime.now()):
    

    #dt= datetime.datetime.now()

    if QA_util_if_trade(str(dt.date())) and dt.time() < datetime.time(15, 0, 0):
        return str(dt.date())
    else:
        return QA_util_get_real_date(str(dt.date()), trade_date_sse, 1)
1031986
def to_date(ts: float) -> datetime.date:
    
    return datetime.datetime.fromtimestamp(
        ts, tz=datetime.timezone.utc).date()
374341
def get_date():
    '''
    
    '''
    ret = salt.utils.mac_utils.execute_return_result('systemsetup -getdate')
    return salt.utils.mac_utils.parse_return(ret)
520581
def datetimes(self):
        """"""
        if self._timestamps_data is None:
            self._calculate_timestamps()
        return tuple(DateTime.from_moy(moy, self.is_leap_year)
                     for moy in self._timestamps_data)
616325
def pendulum_time_to_datetime_time(x: Time) -> datetime.time:
    
    return datetime.time(
        hour=x.hour, minute=x.minute, second=x.second,
        microsecond=x.microsecond,
        tzinfo=x.tzinfo
    )