Timestamp Tool
Online timestamp conversion tool, supporting conversion between Unix timestamp and datetime with multiple timezone support
Online timestamp conversion tool, supporting conversion between Unix timestamp and datetime with multiple timezone support
Definition:
A Unix timestamp (Unix Timestamp) represents the number of seconds elapsed since January 1, 1970, 00:00:00 UTC (excluding leap seconds). It serves as a platform and timezone-independent standard for time representation in computer systems.
Authoritative Definition Sources:
time.h manual page[2] specifies its data type as time_t (typically a signed 32-bit or 64-bit integer).Key Features:
1696118400. While often used interchangeably, GMT (Greenwich Mean Time) and UTC (Coordinated Universal Time) have fundamental differences:
| Aspect | GMT (Greenwich Mean Time) | UTC (Coordinated Universal Time) |
|---|---|---|
| Definition | Based on Earth's rotation (astronomical observation) | Based on atomic clocks (cesium atom oscillation), maintains <0.9s difference from GMT |
| Adjustment | No periodic calibration | Synchronized with Earth's rotation via leap seconds[5] |
| Authority | Originally defined by Greenwich Observatory, now used as timezone identifier (UTC+0) | Maintained by ITU[6] and BIPM[7] |
Key Facts:
Etc/UTC and Etc/GMT represent zero offset, but the latter uses inverse signs (e.g., GMT+1 actually means UTC-1).Timestamp → Local Time Formula:
Local Time = Unix Timestamp + Timezone Offset + Leap Second Compensation
Authoritative Tools and Standards:
America/New_York represents UTC-5/UTC-4) YYYY-MM-DDTHH:mm:ss±HH:mm (e.g., 2023-10-01T08:00:00-04:00) Sample Code (Python):
import datetime
timestamp = 1696118400
# Convert to UTC
utc_time = datetime.datetime.utcfromtimestamp(timestamp) # 2023-10-01 00:00:00
# Convert to Eastern Time (UTC-4)
local_time = datetime.datetime.fromtimestamp(timestamp, datetime.timezone(datetime.timedelta(hours=-4))) # 2023-10-01 04:00:00-04:00
Leap Second Mechanism:
| System Compatibility: | System/Language | Leap Second Handling | Official Documentation |
|---|---|---|---|
| Linux | Kernel supports leap second insertion, requires manual configuration | Linux Kernel Leap Second Handling | |
| Java | java.time API ignores leap seconds |
Oracle Java Docs | |
| Google Public NTP | Uses "leap smearing" strategy during leap second insertion | Google Leap Smearing |
Understanding these concepts ensures precise time logic control in critical systems like financial transactions and log synchronization.
time.h Manual Page: Run man 3 time in terminal