Skip to content

Unix ms to SQL datetime converter

Unix timestamp in milliseconds → SQL datetime (YYYY-MM-DD HH:mm:ss)

Swap → SQL datetime to Unix ms

SQL datetime · YYYY-MM-DD HH:mm:ss

2024-06-29 00:00:00

A Unix timestamp has no clock of its own: it is written as its UTC clock.

Worked examples

InstantUnix msSQL datetime
an ordinary afternoon17827434000002026-06-29 14:30:00
a leap day18354279070002028-02-29 09:05:07
the Unix epoch01970-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

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.