📅 日期时间转换

Unix 时间戳与 ISO 日期时间互转,支持多种格式显示

⏱ 快捷操作
🔢 Unix 时间戳
📆 ISO 日期时间
📋 日期格式
💻 常用语言/数据库获取时间戳
编程语言
数据库

What is a Unix Timestamp?

A Unix timestamp is the number of seconds or milliseconds that have elapsed since January 1, 1970 00:00:00 UTC (the Unix epoch). It is a time representation widely used in computer systems, supported by virtually all programming languages and operating systems.

The greatest advantage of Unix timestamps is that they are pure numbers — they contain no timezone information and are unaffected by daylight saving time, making them ideal for time exchange, storage, and computation between computer systems.

Second-Level vs Millisecond-Level Timestamps

Unix timestamps come in two common precisions:

When using timestamps, always confirm whether the API or database expects seconds or milliseconds — otherwise, you risk time offsets of decades.

What is ISO 8601?

ISO 8601 is the international standard for date and time representation (ISO 8601:2004). It defines a globally unified, unambiguous datetime string format: YYYY-MM-DDTHH:mm:ss.sss±hh:mm.

Advantages of ISO 8601:

Common ISO 8601 format examples:

RFC 2822 Format

RFC 2822 is the datetime format used in email and HTTP protocols, e.g., Mon, 15 Jan 2024 10:30:00 +0000. While less modern and concise than ISO 8601, it is still widely seen in HTTP headers such as Date and Last-Modified.

The Importance of Timezones

The same instant in time is expressed differently around the world. For example, when it is 10:30 AM in London on January 15, 2024, it is already 6:30 PM in Beijing. Handling timezones correctly in software development is critical:

Common Use Cases for Unix Timestamps

Use CaseDescription
API Data ExchangeMost REST APIs use Unix timestamps or ISO 8601 for time fields; JSON natively supports both formats.
Logging SystemsLog collection and analysis systems (e.g., Elasticsearch, Grafana) use timestamps for event timing and sorting.
Database Time ColumnsMySQL's TIMESTAMP and PostgreSQL's TIMESTAMPTZ internally store times as UTC timestamps.
JWT TokensJWT iat (issued at) and exp (expiration) fields use second-level Unix timestamps.
Cache ExpiryRedis, Memcached, and other caching systems use timestamps to mark cache item lifetimes.
Distributed SystemsTimestamps are commonly used for ordering and idempotency in distributed transactions and message queues.
File SystemsFile creation and modification times are stored as timestamps.

Common Timestamp Conversion Issues

Why Use an Online Timestamp Conversion Tool?

In daily development, developers frequently need to quickly perform these operations:

Our online date-time converter offers an all-in-one solution:

Whether you're a frontend, backend, or full-stack developer, this is an indispensable time utility in your daily workflow.