---
title: "时区只支持固定偏移"
---

> Documentation Index
> Fetch the complete documentation index at: https://koine.systems/llms.txt
> Use this file to discover all available pages before exploring further.

# 时区只支持固定偏移

## 背景

业务时间可能涉及本地时区、夏令时和时区规则。完整实现需要时区数据库和规则引擎。

## 选项

- 完整时区数据库。
- 只支持固定偏移。
- 只支持 UTC。

## 决定

只支持固定偏移。`Timestamp` 带固定偏移，比较时归一化到 UTC。不建模夏令时和时区规则。

## 理由

- 多数业务时间戳只需要一个明确的偏移。
- 完整时区规则会增加运行时依赖和不可预测性。
- agent 不需要理解“某地某年某月是否夏令时”。

## 后果

`Date` 和 `Time` 不带时区；转 `Timestamp` 必须显式给偏移。需要本地时区展示时，由工具链在表现层处理。

Source: https://koine.systems/notes/decisions/0009-fixed-offset-timezone/index.mdx
