Epoch & Unix Timestamp Converter
Convert Unix timestamps to human-readable dates and formats in UTC, ISO 8601, and your local timezone. Works with seconds, milliseconds, microseconds, and nanoseconds.
Como funciona
Fórmula
Date = new Date(timestamp × 1000) | Epoch = Math.floor(Date.now() / 1000) Exemplo prático
Epoch timestamp 1700000000 converts to Tuesday, November 14, 2023 10:13:20 PM UTC (or 2023-11-14T22:13:20Z).
Understanding Unix Timestamps and the Epoch
The Unix epoch is the universal reference point used across operating systems, distributed databases, cloud APIs, and programming runtimes to measure time independently of geographical time zones and daylight saving time (DST) shifts.
Seconds vs. Milliseconds vs. Microseconds
When debugging API payloads or database records, identifying the unit of measurement is the most common hurdle:
| Unit | Number of Digits | Example | Common Runtime / Use Case |
|---|---|---|---|
| Seconds | 10 digits | 1742400000 | Linux CLI, Unix kernel, Redis, JWT expiry |
| Milliseconds | 13 digits | 1742400000000 | JavaScript, Java, MongoDB ISODate |
| Microseconds | 16 digits | 1742400000000000 | Python datetime, Cassandra, PostgreSQL |
| Nanoseconds | 19 digits | 1742400000000000000 | Go time.Now().UnixNano(), InfluxDB |
Common Conversion Snippets
- JavaScript / Node.js:
// Current epoch seconds const sec = Math.floor(Date.now() / 1000); // Epoch to Date const date = new Date(1742400000 * 1000); - Python 3:
import time from datetime import datetime, timezone # Epoch to UTC string utc_time = datetime.fromtimestamp(1742400000, tz=timezone.utc) - PostgreSQL:
SELECT TO_TIMESTAMP(1742400000);
Perguntas frequentes
What is Unix Epoch time?
Unix epoch time (or POSIX time) is the number of seconds that have elapsed since 00:00:00 UTC on Thursday, 1 January 1970, not counting leap seconds.
How do I know if my timestamp is in seconds or milliseconds?
Standard 10-digit integers (e.g. 1700000000) represent seconds. Standard 13-digit integers (e.g. 1700000000000) represent milliseconds (used by JavaScript `Date.now()`). 16-digit timestamps represent microseconds, and 19-digit timestamps represent nanoseconds.
What is the Year 2038 problem (Y2038)?
On January 19, 2038 at 03:14:07 UTC, 32-bit signed integers will overflow from 2,147,483,647 to -2,147,483,648, wrapping back to the year 1901. Modern 64-bit systems are immune and safe for billions of years.
How do I get the current epoch timestamp in programming languages?
In JavaScript: `Math.floor(Date.now() / 1000)`. In Python: `import time; int(time.time())`. In PHP: `time()`. In SQL: `UNIX_TIMESTAMP()`.
Ferramentas relacionadas
← Ver todas as ferramentas de outras calculadorasContador De Dias Calculator
pt-BR: dias entre duas datas (incluir ultimo dia), dias ate uma data futura (contagem regressiva), somar/subtrair dias.
Calculadora De Horas Trabalhadas Calculator
pt-BR: rows of entrada, saida, intervalo -> horas do dia; week/month total; hora extra above jornada (default 8h/44h); output hh:mm and decimal.
Calculadora Entre Datas Calculator
pt-BR: diferenca entre duas datas in anos/meses/dias, total dias/semanas/meses; adicionar/subtrair periodo.
Calculadora De Investimentos Calculator
pt-BR: aporte inicial, aporte mensal, taxa (a.a. or a.m. toggle), prazo -> montante = FV with contributions; optional IR regressivo (22.5% up to 180d, 20% 181-360d, 17.5% 361-720d, 15% >720d); CDI/Selic/poupanca reference rates come from data/rates.json and are editable, never hard-coded.
Calculadora De Pace Calculator
Same logic as pace calculator, native pt-BR UI/copy: ritmo por km/milha, provas (5K,10K,21K,42K).