[comment]: # ({7b2765b5-493edd72})
# 3 日期时间函数

以下列出的所有函数均支持于:

-   [Trigger expressions](/manual/config/triggers/expression)
-   [Calculated items](/manual/config/items/itemtypes/calculated)

::: noteimportant
日期时间函数不能单独在表达式中使用，必须至少包含一个来自[another group](/manual/appendix/functions)的函数（引用主机 监控项），但nodata函数除外。有关日期时间函数在表达式中如何工作的详细信息，请参阅[计算时间](/manual/config/triggers#计算时间)。

:::

| 函数 | <   | <   |
|--|--|--|
| **Description** | **函数特定参数** | **说明** |
| **date** | <   | <   |
| Current date in YYYYMMDD format. |     | 示例:<br>=> **date**()<20220101 |
| **dayofmonth** | <   | <   |
| Day of month in range of 1 to 31. |     | 示例:<br>=> **dayofmonth**()=1 |
| **dayofweek** | <   | <   |
| Day of week in range of 1 to 7 (Mon - 1, Sun - 7). |     | 示例（仅工作日）:<br>=> **dayofweek**()<6<br><br>示例（仅周末）:<br>=> **dayofweek**()>5 |
| **now** | <   | <   |
| Number of seconds since the Epoch (00:00:00 UTC, January 1, 1970). |     | 示例:<br>=> **now**()<1640998800 |
| **time** | <   | <   |
| Current time in HHMMSS format. |     | 示例（仅夜间时段00:00-06:00）:<br>=> **time**()<060000 |

[comment]: # ({/7b2765b5-493edd72})
