timezone.fixed() 函数
timezone.fixed() 返回一个具有固定偏移量的位置记录。
函数类型签名
(offset: A) => {zone: string, offset: A}
有关更多信息,请参见 Function type signatures。
参数
偏移量
(必填) 位置偏移的固定持续时间。 该持续时间是相对于UTC的偏移。
示例
返回固定位置记录
import "timezone"
timezone.fixed(offset: -8h)// Returns {offset: -8h, zone: "UTC"}
使用固定位置设置位置选项
import "timezone"
// This results in midnight at 00:00:00-08:00 on any day.
option location = timezone.fixed(offset: -8h)
该 location 选项仅影响用于窗口的边界,特别是在时间偏移(如夏令时)周围。它不会改变 _time 列中的时间戳,这些时间戳始终是 UTC。