Unix ms to SQL datetime converter
Unix timestamp in milliseconds → SQL datetime (YYYY-MM-DD HH:mm:ss)
SQL datetime · YYYY-MM-DD HH:mm:ss
A Unix timestamp has no clock of its own: it is written as its UTC clock.
Worked examples
| Instant | Unix ms | SQL datetime |
|---|---|---|
| an ordinary afternoon | 1782743400000 | 2026-06-29 14:30:00 |
| a leap day | 1835427907000 | 2028-02-29 09:05:07 |
| the Unix epoch | 0 | 1970-01-01 00:00:00 |
What this conversion changes
- Unix ms counts milliseconds since 1970-01-01T00:00:00Z; the result is that instant written as calendar fields in UTC.
- Dropped on the way out: milliseconds. The conversion is lossy; converting back will not restore them.
Unix ms — Unix timestamp in milliseconds
- Pattern
- Unix Timestamp (ms)
- Example
- 1719619200000
- Seen in
- JavaScript Date.now(), Java System.currentTimeMillis(), Kafka, Analytics exports
SQL datetime — SQL datetime (YYYY-MM-DD HH:mm:ss)
- Pattern
- YYYY-MM-DD HH:mm:ss
- Example
- 2022-06-29 13:45:31
- Seen in
- MySQL DATETIME, PostgreSQL timestamp, SQLite, CSV exports from databases
Related conversions
Thousands of values to convert?
CSV batch mode converts an entire column from Unix ms to SQL datetime (or any of the 82 formats, with time-zone shifts), entirely in your browser, with no row limit set by us (your device's memory is the practical ceiling). $9.99/month, hides the ads, cancel anytime.