Which UTC day contains a midnight event with an offset?

SQLite date functions normalize an input offset to UTC before extracting its date.

SQLite example and interpretation

At 1 a.m. in Beijing on March first it is still the last day of February in UTC. Define the reporting zone before grouping events by day.

SELECT date('2024-03-01T01:00:00+08:00');

Result [["2024-02-29"]]

中文

带时区偏移的午夜记录属于哪一个 UTC 日?

SQLite 日期函数将带偏移的输入换算到 UTC,再进行日期提取。

SQLite 示例与适用条件

北京时间 3 月 1 日凌晨 1 点,UTC 仍是 2 月最后一天。按运营地分组前需先定义报告时区。

SELECT date('2024-03-01T01:00:00+08:00');

结果 [["2024-02-29"]]

References / 参考来源

Keep reading / 继续阅读