add aliyun apis

This commit is contained in:
jxxghp
2024-06-17 19:45:39 +08:00
parent ce1db7f62b
commit 1b6a06bd7b
7 changed files with 457 additions and 19 deletions

View File

@ -383,6 +383,21 @@ class StringUtils:
print(str(e))
return timestamp
@staticmethod
def str_to_timestamp(date_str: str) -> float:
"""
日期转时间戳
:param date_str:
:return:
"""
if not date_str:
return 0
try:
return dateparser.parse(date_str).timestamp()
except Exception as e:
print(str(e))
return 0
@staticmethod
def to_bool(text: str, default_val: bool = False) -> bool:
"""