¿Qué significa 1694678400?
A primera vista es un número sin sentido. Pero para una computadora significa 15 de septiembre de 2023, 00:00:00 UTC. Y para otra cifra parecida, la interpretación puede cambiar totalmente según esté en segundos o en milisegundos. Bajo esos dígitos se esconde el mecanismo que hace que bases de datos, APIs y navegadores entiendan el tiempo.
¿Qué es un timestamp?
Un timestamp Unix (también llamado Unix time o epoch) es el número de segundos transcurridos desde el 1 de enero de 1970, 00:00:00 UTC. Esa fecha inicial —la «época Unix» o epoch— es el punto de partida universal que eligieron los creadores de Unix en los años 70.
Las computadoras usan este sistema porque es eficiente: no hay que almacenar formatos como «lunes, 14 de septiembre de 2026» o manejar nombres de meses en distintos idiomas. Un solo entero sirve para almacenar, comparar y ordenar cualquier instante.
Dato curioso: el timestamp del momento en que la misión Apolo 11 alunizó (20 de julio de 1969) sería negativo, porque ocurrió antes de la época Unix.
Segundos vs milisegundos
No todos los timestamps significan lo mismo: hay dos variantes comunes y confundirlas da un resultado completamente erróneo.
| Formato | Dígitos | Ejemplo | Escala |
|---|---|---|---|
| Segundos | 10 | 1694678400 |
Clásica, usada por PHP, Python, bases SQL, APIs |
| Milisegundos | 13 | 1694678400000 |
Moderna, usada por JavaScript, Java, algunos servicios web |
Para distinguirlos, basta con contar dígitos: 10 dígitos = segundos, 13 dígitos = milisegundos. Y si tu herramienta te devuelve una fecha en el año 58.000, seguramente pasaste milisegundos a una entrada que esperaba segundos: divide entre 1.000 y vuelve a intentar.
Consejo: si tu timestamp parece demasiado grande, prueba a dividirlo entre 1.000. Si parece demasiado pequeño y la fecha sale en 1970, multiplícalo por 1.000.
Tabla de timestamps de referencia
Aquí tienes fechas conocidas y sus timestamps en segundos para que practiques:
| Fecha (00:00:00 UTC) | Timestamp (segundos) |
|---|---|
| 01/01/2000 | 946684800 |
| 01/01/2010 | 1262304000 |
| 01/01/2020 | 1577836800 |
| 01/01/2024 | 1704067200 |
| 14/09/2026 | 1789344000 |
Para pasar cualquiera de esos valores a milisegundos, añade tres ceros al final: por ejemplo, 1789344000000.
Advertencia: los valores anteriores se calculan a medianoche UTC. Si usas una zona horaria local (por ejemplo España, UTC+2 en verano), el timestamp numérico será el mismo pero la hora legible se desplazará dos horas.
¿Dónde se usa?
El timestamp aparece en más lugares de los que se ve:
- Bases de datos: columnas
created_at,updated_aty registros de eventos en formato entero. - APIs (JSON): las respuestas de servicios web suelen incluir fechas como timestamps para evitar ambigüedades de formato.
- Logs del servidor: cada línea lleva un timestamp para depurar con precisión cronológica.
- Cookies y JWT: el campo
exp(expiry) determina cuándo caduca una sesión. - Control de versiones (git): cada commit guarda su fecha exacta como timestamp.
- JavaScript:
Date.now()devuelve el número de milisegundos desde la época, úsalo así en el navegador.
Consejo para desarrolladores: en JavaScript recuerda que
Date.now()devuelve milisegundos; si tu API espera segundos, divide entre 1.000 y redondea.
Conclusión
Un timestamp es solo un número, pero encierra la fecha y hora exactas de cualquier evento desde 1970. Entender la diferencia entre segundos y milisegundos, reconocer el formato a partir de los dígitos y saber dónde se usa es clave para depurar APIs, leer logs y construir aplicaciones web.
What does 1694678400 mean?
At first glance it is a meaningless number. But for a computer it means September 15, 2023, 00:00:00 UTC. And for a similar-looking value the interpretation can change entirely depending on whether it is expressed in seconds or in milliseconds. Hidden beneath those digits lies the mechanism that lets databases, APIs and browsers understand time.
What is a timestamp?
A Unix timestamp (also called Unix time or epoch) is the number of seconds elapsed since January 1, 1970, 00:00:00 UTC. That starting date — the “Unix epoch” — is the universal reference point chosen by the creators of Unix in the 1970s.
Computers use this system because it is efficient: there is no need to store a string like “Sunday, September 14, 2026” or handle month names in different languages. A single integer is enough to store, compare and sort any moment in time.
Fun fact: the timestamp of the Apollo 11 moon landing (July 20, 1969) would be negative, because it happened before the Unix epoch.
Seconds vs milliseconds
Not every timestamp means the same thing: there are two common variants and mixing them up gives a completely wrong result.
| Format | Digits | Example | Used by |
|---|---|---|---|
| Seconds | 10 | 1694678400 |
Classic — PHP, Python, SQL databases, many APIs |
| Milliseconds | 13 | 1694678400000 |
Modern — JavaScript, Java, some web services |
To tell them apart, just count the digits: 10 digits = seconds, 13 digits = milliseconds. And if your tool returns a date in the year 58,000, chances are you fed milliseconds into an input that expected seconds — divide by 1,000 and try again.
Tip: if the timestamp looks too large, divide it by 1,000. If it looks too small and the date comes back in 1970, multiply it by 1,000.
Reference timestamps table
Here are some well-known dates and their timestamps in seconds for practice:
| Date (00:00:00 UTC) | Timestamp (seconds) |
|---|---|
| 01/01/2000 | 946684800 |
| 01/01/2010 | 1262304000 |
| 01/01/2020 | 1577836800 |
| 01/01/2024 | 1704067200 |
| 14/09/2026 | 1789344000 |
To turn any of these values into milliseconds, append three zeros at the end: for example, 1789344000000.
Note: the values above are calculated at midnight UTC. If you work in a local timezone (e.g. Central European Summer Time, UTC+2), the numeric timestamp stays the same but the readable time will shift by two hours.
Where is it used?
Timestamps appear in more places than meets the eye:
- Databases:
created_at,updated_atcolumns and event logs stored as integers. - APIs (JSON): web service responses often include dates as timestamps to avoid format ambiguity.
- Server logs: each line carries a timestamp for precise chronological debugging.
- Cookies and JWTs: the
exp(expiry) field determines when a session expires. - Version control (git): every commit stores its exact date as a timestamp.
- JavaScript:
Date.now()returns the millisecond count since the epoch — use it in the browser.
Developer tip: in JavaScript remember that
Date.now()returns milliseconds; if your API expects seconds, divide by 1,000 and round.
Conclusion
A timestamp is just a number, but it holds the exact date and time of any event since 1970. Understanding the difference between seconds and milliseconds, recognizing the format from the digit count, and knowing where it is used are key skills for debugging APIs, reading logs and building web applications.