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