后端新增《蚕茧识别V2》模块
This commit is contained in:
@@ -20,3 +20,7 @@ def format_datetime(dt: datetime, tz="Asia/Shanghai"):
|
||||
tz_obj = pytz.timezone(tz)
|
||||
dt = dt.astimezone(tz_obj)
|
||||
return dt.strftime("%Y-%m-%d %H:%M:%S")
|
||||
|
||||
|
||||
def safe_round(value, ndigits=2, default=None):
|
||||
return round(value, ndigits) if value is not None else default
|
||||
|
||||
Reference in New Issue
Block a user