Add token related interfaces (#495)

This commit is contained in:
Wu Clan
2025-01-23 13:12:46 +08:00
committed by GitHub
parent 7553ccf14d
commit 3b65679fb0
14 changed files with 306 additions and 116 deletions
+11
View File
@@ -39,6 +39,17 @@ class TimeZone:
"""
return datetime.strptime(date_str, format_str).replace(tzinfo=self.tz_info)
@staticmethod
def t_str(dt: datetime, format_str: str = settings.DATETIME_FORMAT) -> str:
"""
时间转时间字符串
:param dt:
:param format_str:
:return:
"""
return dt.strftime(format_str)
@staticmethod
def f_utc(dt: datetime) -> datetime:
"""