Unix Zaman Damgası Nedir? Epoch Time'ın Tam Açıklaması
Quick Answer
Unix timestamp, 1 Ocak 1970, 00:00:00 UTC'den (Unix epoch) bu yana saniye sayısıdır. Timezone-bağımsız ve karşılaştırması kolay. JavaScript milisaniye (13 rakam); Unix ve çoğu API saniye (10 rakam) kullanır. Ücretsiz Timestamp Converter kullanın.
Introduction
Unix timestamp (Unix epoch time, POSIX time veya Unix time da denir), 1 Ocak 1970, 00:00:00 UTC'den —Unix epoch olarak bilinen an —bu yana geçen saniye sayısıdır. Timestamp'ler timezone-bağımsız (her zaman UTC), karşılaştırması kolay ve kompakt olduğu için işletim sistemlerinde, veritabanlarında, loglarda ve API'lerde yaygın olarak kullanılır. Ancak insan-okunabilir değildir —1693526400 dönüştürme olmadan hiçbir şey ifade etmez.
Step by Step
-
Understand the Unix epoch
The Unix epoch is January 1, 1970, 00:00:00 Coordinated Universal Time (UTC). A Unix timestamp is the count of seconds from this moment. Positive timestamps are after the epoch; negative timestamps (supported by some systems) are before it.
-
Distinguish seconds from milliseconds
Unix timestamps are typically in seconds (10 digits as of 2026, e.g., 1693526400). JavaScript's Date.now() and Date.getTime() return milliseconds (13 digits, e.g., 1693526400000). Always check which unit an API expects — mixing them is the most common timestamp bug.
-
Understand timezone independence
Unix timestamps are always UTC. They do not depend on the user's timezone. To display a timestamp in a specific timezone, convert it to a date and apply the timezone offset. This makes timestamps ideal for storage and comparison.
-
Learn about the Year 2038 problem
Systems using 32-bit signed integers for timestamps will overflow on January 19, 2038, 03:14:07 UTC — the 'Y2038 problem'. Systems using 64-bit integers or JavaScript numbers (64-bit floats) are unaffected. Modern systems are largely Y2038-safe, but legacy embedded systems may not be.
Examples
Timestamp for a known date
Input: 2023-09-01 00:00:00 UTC
Output: 1693526400 (seconds) or 1693526400000 (milliseconds)
The Unix epoch
Input: 1970-01-01 00:00:00 UTC
Output: 0
Y2038 problem boundary
Input: 2038-01-19 03:14:07 UTC
Output: 2147483647 (max 32-bit signed integer)
Common Problems
- Mixing seconds and milliseconds —JavaScript uses milliseconds (Date.now()), Unix and most APIs use seconds. Divide by 1000 to convert ms to seconds; multiply by 1000 for the reverse.
- Timezone confusion —timestamps are UTC. When displaying, convert to the user's local timezone or specify UTC. Do not apply offsets to the raw timestamp.
- The Year 2038 problem —32-bit signed integer timestamps overflow on 2038-01-19. Use 64-bit integers or JavaScript numbers to avoid this.
- Negative timestamps —dates before 1970-01-01 have negative timestamps. Some systems do not support them.
Tips
- Always check whether an API expects seconds or milliseconds —this is the most common timestamp bug.
- Use ISO 8601 strings (e.g., "2023-09-01T00:00:00Z") for human-readable timestamps in APIs; use Unix epoch for storage and computation.
- JavaScript Date.now() returns milliseconds; divide by 1000 and floor to get seconds.
- Use our Timestamp Converter to convert between timestamps and human-readable dates in your browser.