From b92c5507bc73f043882ccf39fa5376686b4684d6 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期五, 12 四月 2024 11:07:13 +0800 Subject: [PATCH] 新版深证下单完善 --- utils/tool.py | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/utils/tool.py b/utils/tool.py index a3e6479..b2983c3 100644 --- a/utils/tool.py +++ b/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)) -- Gitblit v1.8.0