15 lines
260 B
Python
15 lines
260 B
Python
"""通用工具函数"""
|
|
|
|
import uuid
|
|
from datetime import datetime, timezone
|
|
|
|
|
|
def generate_uuid() -> str:
|
|
"""生成 UUID"""
|
|
return str(uuid.uuid4())
|
|
|
|
|
|
def now_utc() -> datetime:
|
|
"""获取当前 UTC 时间"""
|
|
return datetime.now(timezone.utc)
|