boundaries.friday() 函数
boundaries.friday()
返回一个记录,其中包含上周五的 start
和 stop
边界时间戳。
上周五是相对于 now()
的。如果今天是星期五,该函数将返回上个星期五的边界。
函数类型签名
() => {stop: time, start: time}
有关更多信息,请参阅 函数类型签名。
示例
返回上周五的开始和停止时间戳
import "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 "date/boundaries"
day = boundaries.friday()
from(bucket: "example-bucket")
|> range(start: day.start, stop: day.stop)
此页是否对您有帮助?
感谢您的反馈!