不受系统时间影响。
hive中获取东八区时间:
select from_utc_timestamp(CURRENT_TIMESTAMP,'GMT+8')
mysql获取doris中获取东八区时间:
select date_add(utc_timestamp(), interval 8 hour)
python中获取当前时间的东八区时间,不受操作系统的时间影响:
import datetime
def _utc8_aera():
now = datetime.datetime.utcfromtimestamp(datetime.datetime.timestamp(datetime.datetime.now())) + datetime.timedelta(hours=8)
return now
print(_utc8_aera())