From eb7595ee10e5ce2751fc39ce55e7ea921df69d79 Mon Sep 17 00:00:00 2001 From: Wang Zhiyu Date: Tue, 11 Nov 2025 00:21:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=20/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- timer.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 timer.py diff --git a/timer.py b/timer.py new file mode 100644 index 0000000..f16e272 --- /dev/null +++ b/timer.py @@ -0,0 +1,11 @@ +import time + +def get_daystamp() -> int: + """获取当前日戳(以天为单位的整数时间戳)""" + + return int((time.time() + 8 * 3600) // (24 * 3600)) + +def get_timestamp() -> float: + """获取 UNIX 时间戳""" + # 搞这个类的原因是要支持可复现操作 + return time.time()