> For the complete documentation index, see [llms.txt](https://doc.duaer.com/zh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/zh/build/date-time.md).

# 在 Duaer 里用 Date & Time 处理时间

在 Duaer 里，Date & Time 默认 Operation 是 Get Current Date。只在表达式里取当前时间时，也可以用 {{ $now }}，不必加这个节点。
## 取出当前时间

1. 搜索 Date & Time，接到上一个节点后面。
2. Operation 保持 Get Current Date。
3. Include Current Time 默认打开。关掉时时间落到当天 0 点。
4. Output Field Name 默认是 currentDate。
5. 点执行此步骤。输出里多了这个字段。

其他 Operation：Add to a Date、Subtract From a Date、Format a Date、Extract Part of a Date、Get Time Between Dates、Round a Date。

Options 里的 Include Input Fields 打开后，会保留输入条目上的原有字段。Timezone 可单独指定时区。表达式写法见 [在 Duaer 里用 Luxon 处理日期](/zh/code/cookbook/luxon.md)。
## Questions

### Duaer 里只要在 Edit Fields 里填当前时间，还要加 Date & Time 吗？

不必。表达式 {{ $now }} 或 {{ $today }} 就够。节点适合要加减、格式化或算两个日期差的时候。

