docs/docs/en/data-sources/data-modeling/collection-fields/datetime/index.md
Date and time field types include:
Examples of date-related field types:
| Field type | Example value | Description |
|---|---|---|
| DateTime (with time zone) | 2024-08-24T07:30:00.000Z | A date-time value normalized to UTC. |
| DateTime (without time zone) | 2024-08-24 15:30:00 | A date-time value without time-zone information. |
| Date (without time) | 2024-08-24 | Stores only date information. |
| Time | 15:30:00 | Stores only time information. |
| Unix timestamp | 1724437800 | Seconds elapsed since 00:00:00 UTC on January 1, 1970. |
The following table compares NocoBase, MySQL, and PostgreSQL types:
| Field type | NocoBase | MySQL | PostgreSQL |
|---|---|---|---|
| DateTime (with time zone) | Datetime with timezone | TIMESTAMP | |
| DATETIME | TIMESTAMP WITH TIME ZONE | ||
| DateTime (without time zone) | Datetime without timezone | DATETIME | TIMESTAMP WITHOUT TIME ZONE |
| Date (without time) | Date | DATE | DATE |
| Time | Time | TIME | TIME WITHOUT TIME ZONE |
| Unix timestamp | Unix timestamp | INTEGER | |
| BIGINT | INTEGER | ||
| BIGINT | |||
| Time (with time zone) | - | - | TIME WITH TIME ZONE |
Notes:
TIMESTAMP supports values from UTC 1970-01-01 00:00:01 through 2038-01-19 03:14:07. Outside this range, use DATETIME or BIGINT to store a Unix timestamp.This flow includes DateTime (without time zone) and Unix timestamp handling.
Notes:
TZ environment variable. If the TZ environment variable changes, stored date-time values can change.UTC (Coordinated Universal Time) is the global time standard used to coordinate and unify time around the world. It is a high-precision time standard based on atomic clocks and synchronized with the time of the Earth's rotation.
UTC and local time differ by time zone. Displaying a raw UTC value directly can confuse users. For example:
| Time zone | Date and time |
|---|---|
| UTC | 2024-08-24T07:30:00.000Z |
| China Standard Time (UTC+8) | 2024-08-24 15:30:00 |
| UTC+5 | 2024-08-24 12:30:00 |
| UTC-5 | 2024-08-24 02:30:00 |
| UK time (UTC+0) | 2024-08-24 07:30:00 |
| Central Time (UTC-6) | 2024-08-23 01:30:00 |
These values represent the same moment in time; only the time zone differs.