utils/tool.py
@@ -244,6 +244,16 @@ return time_seconds_format(s - 2 - cha) def to_time_with_ms(time_s_str, time_ms): """ 将时间+毫秒数 转为字符串 @param time_s_str: 时间如:10:00:00 @param time_ms: 毫秒如: 12 @return: 如:10:00:00.001 """ return f"{time_s_str}." + "{0:0>3}".format(time_ms) # 全角转半角 def strQ2B(ustring): rstring = "" @@ -329,4 +339,4 @@ if __name__ == "__main__": print(trade_time_add_second("11:29:50",15)) print(to_time_with_ms("11:29:50", 15))