| | |
| | | time_str = datetime.datetime.now().strftime("%H:%M:%S") |
| | | return time_str |
| | | |
| | | def get_now_time_with_ms_str(): |
| | | now = datetime.datetime.now() |
| | | ms = int(now.microsecond / 1000) |
| | | time_str = now.strftime(f"%H:%M:%S.{ms:03d}") |
| | | return time_str |
| | | |
| | | |
| | | def get_now_datetime_str(): |
| | | time_str = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") |
| | |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | print(is_sz_code("0000")) |
| | | print(get_now_time_with_ms_str()) |
| | | print(get_now_time_with_ms_str()) |
| | | print(get_now_time_with_ms_str()) |
| | | time.sleep(0.001) |
| | | print(get_now_time_with_ms_str()) |