def datetime(self): """ [datetime.datetime] 当前快照数据的时间戳 """ if self._dt is not None: return self._dt if not self.isnan: dt = self._data['datetime'] if dt > 10000000000000000: # ms return convert_ms_int_to_datetime(dt) else: return convert_int_to_datetime(dt) return datetime.datetime.min
def datetime(self): """ [datetime.datetime] 当前快照数据的时间戳 """ try: dt = self._tick_dict['datetime'] except (KeyError, ValueError): return datetime.datetime.min else: if not isinstance(dt, datetime.datetime): if dt > 10000000000000000: # ms return convert_ms_int_to_datetime(dt) else: return convert_int_to_datetime(dt) return dt
def datetime(self): """ [datetime.datetime] 当前快照数据的时间戳 """ try: dt = self._tick_dict['datetime'] except (KeyError, ValueError): return datetime.datetime.min else: if not isinstance(dt, datetime.datetime): if dt > 10000000000000000: # ms return convert_ms_int_to_datetime(dt) else: return convert_int_to_datetime(dt) return dt