boundaries.sunday() 函数
boundaries.sunday()
是实验性的,并且随时可能更改。
boundaries.sunday()
返回一个记录,其中包含上周日的 start
和 stop
边界时间戳。
上周日是相对于 now()
的。如果今天是星期日,则该函数返回上周日的边界。
函数类型签名
() => {stop: time, start: time}
有关更多信息,请参阅函数类型签名。
示例
返回上周日的开始和停止时间戳
import "experimental/date/boundaries"
option location = timezone.fixed(offset: -8h)
option now = () => 2021-12-30T00:40:44Z
boundaries.sunday()// Returns {start: 2021-12-26T08:00:00Z, stop:2021-12-27T08:00:00Z }
查询上周日收集的数据
import "experimental/date/boundaries"
day = boundaries.sunday()
from(bucket: "example-bucket")
|> range(start: day.start, stop: day.stop)
此页是否对您有帮助?
感谢您的反馈!