Table of Contents

3 日期时间函数

此处列出的所有函数均支持以下场景:

日期时间函数不能单独在表达式中使用;必须至少包含一个来自another group的函数(引用主机监控项),但nodata函数除外。有关日期时间函数在表达式中运作的详细信息,请参阅计算时间

函数
Description 函数特定参数 说明
date
Current date in YYYYMMDD format. 示例:
=> date()<20220101
dayofmonth
Day of month in range of 1 to 31. 示例:
=> dayofmonth()=1
dayofweek
Day of week in range of 1 to 7 (Mon - 1, Sun - 7). 示例(仅工作日):
=> dayofweek()<6

示例(仅周末):
=> dayofweek()>5
now
Number of seconds since the Epoch (00:00:00 UTC, January 1, 1970). 示例:
=> now()<1640998800
time
Current time in HHMMSS format. 示例(仅夜间00:00-06:00):
=> time()<060000