提交 034de9d2 authored 作者: 贺阳's avatar 贺阳

优化

上级 35b97237
...@@ -34,7 +34,7 @@ class CommonCommon(models.Model): ...@@ -34,7 +34,7 @@ class CommonCommon(models.Model):
except Exception as e: except Exception as e:
# 如果出现任何错误,返回UTC时间 # 如果出现任何错误,返回UTC时间
logging.warning(f"获取Odoo时区失败,使用UTC时间: {str(e)}") logging.warning(f"获取Odoo时区失败,使用UTC时间: {str(e)}")
return local_time.astimezone(pytz.UTC).strftime('%Y-%m-%d %H:%M:%S'), '+0' return self.get_utc_time(), '+0'
def get_timezone_offset(self): def get_timezone_offset(self):
""" """
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论