mirror of
https://github.com/fastapi-practices/fastapi-best-architecture.git
synced 2026-09-21 13:12:24 +00:00
Add token related interfaces (#495)
This commit is contained in:
@@ -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:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user