백엔드 프레임 설계
This commit is contained in:
1 parent
d264104077
commit
f7833ba466
62 files changed
+1397
No files matched your search
@@ -0,0 +1,21 @@
|
||||
from datetime import datetime, timezone, timedelta
|
||||
|
||||
|
||||
class GTime:
|
||||
"""서버 전역에서 UTC 기준 시간을 사용하기 위한 유틸. (원본 DerbyServer 패턴 축약)"""
|
||||
|
||||
@staticmethod
|
||||
def UTC() -> datetime:
|
||||
return datetime.now(timezone.utc).replace(tzinfo=None)
|
||||
|
||||
@staticmethod
|
||||
def UTCStr(fmt: str = "%Y-%m-%d %H:%M:%S") -> str:
|
||||
return GTime.UTC().strftime(fmt)
|
||||
|
||||
@staticmethod
|
||||
def AddMinutes(minutes: int) -> datetime:
|
||||
return GTime.UTC() + timedelta(minutes=minutes)
|
||||
|
||||
@staticmethod
|
||||
def AddDays(days: int) -> datetime:
|
||||
return GTime.UTC() + timedelta(days=days)
|
||||
Reference in new issue
Block a user