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()