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