django 中,设置好时区 Time Zone,就不用再去操心时间的转换问题了。
但是在 Flask 中,就没有这种配置了。
So,怎样解决?
天蓬老师2017-04-17 13:45:40
My general approach is that when developing APIs, the time zone is not set in the database or view, or in other words, it is set to the 无时区
state by default. That is a utc time.
The timing is then handled by the API caller. You can pass in the time zone parameter, or directly get the utc time and process it. Compared with the situation xxx hours ago, UTC is OK.
巴扎黑2017-04-17 13:45:40
The background time is unified using UTC time, and Monent.js is used when displaying on the client