测试成功
Topic source用切片整理一下: return datetime.strptime(dt_str, '%Y-%m-%d %H:%M:%S').replace(tzinfo=timezone(timedelta(hours=int(tz_str[3:-3])))).timestamp()
其中tz_str[3:-3]表示tz_str的第4位开始到倒数3位之前
- 1
用切片整理一下: return datetime.strptime(dt_str, '%Y-%m-%d %H:%M:%S').replace(tzinfo=timezone(timedelta(hours=int(tz_str[3:-3])))).timestamp()
其中tz_str[3:-3]表示tz_str的第4位开始到倒数3位之前
筱枫_Edward
def to_timestamp(dt_str, tz_str):