这是原厂英文文档的翻译页面. 欢迎帮助我们 完善文档.
2022 Zabbix中国峰会
2022 Zabbix中国峰会

3 日期和时间函数

此处列出的所有功能都支持:

日期和时间函数不能在表达式中单独使用;至少一个非基于时间函数引用的主机监控项必须出现在表达式中。

函数
描述 特定功能参数 注释
date
YYYYMMDD 格式的当前日期。 例子:
=> date()<20220101
dayofmonth
日期范围为 1 到 31。 例子:
=> dayofmonth()=1
dayofweek
星期几,范围为 1 到 7(周一 - 1,周日 - 7)。 例子:
=> dayofweek()<6
now
自纪元年以来的秒数(00:00:00 UTC,1970 年 1 月 1 日)。 例子:
=> now()<1640998800
time
HHMMSS 格式的当前时间。 例子:
=> time()>000000 and time()<060000

Function details

date

The current date in YYYYMMDD format.

Example:

date()<20220101
dayofmonth

The day of month in range of 1 to 31.

Example:

dayofmonth()=1
dayofweek

The day of week in range of 1 to 7 (Mon - 1, Sun - 7).

Example:

dayofweek()<6
now

The number of seconds since the Epoch (00:00:00 UTC, January 1, 1970).

Example:

now()<1640998800
time

The current time in HHMMSS format.

Example:

time()>000000 and time()<060000

See all supported functions.