| | |
| | | |
| | | return time_1 - time_2 |
| | | |
| | | |
| | | def trade_time_sub_with_ms(time_str_1, time_str_2): |
| | | split_time = get_time_as_second("11:30:00")*1000 |
| | | time_1 = get_time_as_millionsecond(time_str_1) |
| | |
| | | |
| | | def compare_time(time_1: str, time_2: str): |
| | | return int(time_1.replace(":", "")) - int(time_2.replace(":", "")) |
| | | |
| | | |
| | | def compare_time_with_ms(time_1: str, time_2: str): |
| | | return int(time_1.replace(":", "").replace(".", "")) - int(time_2.replace(":", "").replace(".", "")) |
| | | |
| | | |
| | | # 交易时间加几s |
| | |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | print(trade_time_add_millionsecond("10:36:00.123", 1000)) |
| | | print(compare_time_with_ms("10:00:00.123","10:01:01.123")) |
| | | print(trade_time_add_millionsecond("11:29:59.123", 1888)) |