需求是这样。 考虑到多国语言,数据库中存储的都是 utc 时间。
现在用来做格式化显示必须是arrow.get(timestamp).to(current_tz).format()来进行显示。能不能像 php 那样date_default_timezone_set($tz)在某个部分做一次全局时区设置,例如上下文。
arrow.get(timestamp).to(current_tz).format()
date_default_timezone_set($tz)