> For the complete documentation index, see [llms.txt](https://docs.coreway.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coreway.com/yoov-plus/worksheet/worksheet-design/field-type/date-time.md).

# 日期与时间

本字段用于记录所有时间类信息。通过设置不同的显示格式，可将其用作**仅日期**、**仅时间**或**日期时间**字段。

## **1. 显示格式** <a href="#id-1-display-format" id="id-1-display-format"></a>

您可以根据业务需要，选择以下任何一种显示精度：

| 模式       | 格式类型        | 显示示例                  | 常见用途    |
| -------- | ----------- | --------------------- | ------- |
| **日期**   | 年           | `2023`                | 年份记录    |
|          | 年-月         | `2023-01`             | 月度报表    |
|          | 年-月-日       | `2023-01-01`          | 生日、订单日期 |
| **时间**   | 时:分         | `08:30`               | 上班打卡时间  |
|          | 时:分:秒       | `08:30:00`            | 精确计时    |
| **日期时间** | 年-月-日 时     | `2023-01-01 08`       | 粗略日程    |
|          | 年-月-日 时:分   | `2023-01-01 08:30`    | 会议开始时间  |
|          | 年-月-日 时:分:秒 | `2023-01-01 08:30:00` | 系统日志时间  |

## **2. 默认值设置** <a href="#id-2-default-value-setting" id="id-2-default-value-setting"></a>

支持为字段预设自动填充的时间值。

* **固定值**：手动选择一个特定的日期、时间或日期时间。
* **当前时间**：自动填入记录创建时的系统日期和/或时间。
* **动态值**：
  * **其他字段值**：引用本表或关联表中的**日期、时间、日期时间字段**、**日期公式计算结果**或系统字段（`创建时间`、`最近修改时间`）。
  * **查询工作表**：通过时间/日期条件查询其他工作表，并将匹配记录的相关时间值填充至此。
  * **函数计算**：使用日期时间函数（如 `TODAY()`, `NOW()`）的计算结果作为默认值。
* **兼容性说明**：**时间字段**的默认值可设置为**日期类型**，但反之则不行。

## **3. 验证规则** <a href="#id-3-validation-rule" id="id-3-validation-rule"></a>

* **必填**：该字段必须填写。

## **4. 选择范围限制** <a href="#id-4-selection-range-limit" id="id-4-selection-range-limit"></a>

可限制该字段可选值的范围，确保数据合理性。

* **日期范围**：设置**起始日期**和**结束日期**。
* **时间范围**：设置**起始时间**和**结束时间**（仅对“时间”及“日期时间”格式生效）。
* **效果**：在表单中选择时，选择器将仅允许在设定的日期和/或时间范围内操作。

## **5. 时间录入与计算规则** <a href="#id-5-time-input-calculate-rule" id="id-5-time-input-calculate-rule"></a>

* **时间进制规则**：
  * 分、秒值超过 **59** 时，会自动按60进制进位（输入`05:65` → 显示`06:05`）。
  * 小时值超过 **23** 时，会自动按24小时制循环（输入`24:15:30` → 显示`00:15:30`）。
* **日期动态条件**（仅限**日期**或**日期时间**格式）：\
  在查询条件中，支持使用“今天”、“本周”、“上月”、“一年前”等智能相对日期值。

## **6. 从Excel导入数据说明** <a href="#id-6-excel-data-import-guide" id="id-6-excel-data-import-guide"></a>

为确保时间数据正确导入，请在Excel中将源数据单元格格式设置为以下自定义类型：

* **仅日期**：`yyyy-mm-dd` 或 `yyyy/mm/dd`
* **仅时间**：`hh:mm:ss`
* **日期时间**：`yyyy-mm-dd hh:mm:ss` 或 `yyyy/mm/dd hh:mm:ss`

> **重要提示**：系统**不支持**导入其他国家或地区的日期时间格式（如 `dd/mm/yyyy` 或 `mm/dd/yyyy`）。

## **7. 筛选功能** <a href="#id-7-filter-function" id="id-7-filter-function"></a>

在视图配置中，可为此字段启用**快速筛选**。配置后，用户可在工作表页面直接按**日期区间**（如今天、本月）或**时间区间**（如上午、下午）快速筛选记录，极大提升数据查找效率。

<figure><img src="/files/P2IeCBdGxKF0rFMVVKQn" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/7VwZdTNE0fBikZh4ZI6e" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.coreway.com/yoov-plus/worksheet/worksheet-design/field-type/date-time.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
