boundaries.friday() 函数
boundaries.friday()
是实验性的,并且随时可能更改。
boundaries.friday()
返回一个记录,其中包含上周五的 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.friday()// Returns {start: 2021-12-24T08:00:00Z, stop:2022-12-25T08:00:00Z }
查询上周五收集的数据
import "experimental/date/boundaries"
day = boundaries.friday()
from(bucket: "example-bucket")
|> range(start: day.start, stop: day.stop)
此页内容对您有帮助吗?
感谢您的反馈!