Skip to content

Unix Timestamp Converter

Turn Unix timestamps and ISO dates into readable dates, SOQL literals and Apex code.

Runs in your browser. Nothing is uploaded.

Timestamp or date

Detected: Unix time in seconds

Examples

Converted

ISO 8601 (UTC)
2026-11-15T10:00:00.000Z
Unix seconds
1794736800
Unix milliseconds
1794736800000
SOQL DateTime literal
2026-11-15T10:00:00Z
SOQL Date literal (UTC day)
2026-11-15
Apex DateTime (GMT)
DateTime.newInstanceGmt(2026, 11, 15, 10, 0, 0)
Apex from milliseconds
DateTime.newInstance(1794736800000L)
HTTP date
Sun, 15 Nov 2026 10:00:00 GMT
Day of the week (UTC)
Sunday

How to use the Unix Timestamp Converter

  1. Type or paste a Unix timestamp, an ISO 8601 date or an HTTP date. Select Now for the current time.
  2. The tool detects whether a number is in seconds, milliseconds, microseconds or nanoseconds.
  3. Copy any format: ISO 8601, SOQL literals, Apex code, your local time and more.

What a Unix timestamp is

A Unix timestamp counts the seconds since midnight UTC on 1 January 1970. It is how most systems store time internally, because it is a single number with no time zone attached. JavaScript and Java use milliseconds instead of seconds, which is why some timestamps have 13 digits instead of 10.

Dates in SOQL

SOQL compares DateTime fields with literals in a strict format: the date and time in UTC, with a Z or an explicit offset, and no quotes.

SOQL
SELECT Id, Subject
FROM Case
WHERE CreatedDate >= 2026-11-15T10:00:00Z
  AND ClosedDate = 2026-11-20

Date fields such as CloseDate take a plain YYYY-MM-DD date. For rolling ranges, SOQL date literals such as LAST_N_DAYS:30 or THIS_MONTH are often better than fixed dates.

Dates in Apex

Apex
// A specific moment, in GMT
DateTime dt = DateTime.newInstanceGmt(2026, 11, 15, 10, 0, 0);

// From a Unix timestamp in milliseconds
DateTime fromEpoch = DateTime.newInstance(1794736800000L);

// Back to a Unix timestamp
Long epochMs = dt.getTime();

Apex DateTime values are always stored in GMT. Methods such as format() and hour() convert to the running user’s time zone, while their Gmt versions do not. Mixing the two is the most common source of “off by a few hours” bugs.

Features and limitations

What it does

  • Detects seconds, milliseconds, microseconds and nanoseconds from the number of digits.
  • Accepts ISO 8601 with or without a time and offset, and HTTP / RFC 2822 dates.
  • Produces SOQL DateTime and Date literals in exactly the format SOQL requires.
  • Writes Apex DateTime.newInstanceGmt(...) and DateTime.newInstance(milliseconds) code.
  • Shows your local time, your time zone and how long ago or ahead the moment is.

What it does not do

  • Dates without a time zone are treated as UTC, and the tool says so.
  • Natural-language input such as “next Tuesday” is not understood.
  • Salesforce stores dates from the years 1700 to 4000; dates outside that range are flagged.

Questions about the Unix Timestamp Converter

Current timestamps in seconds have 10 digits; in milliseconds they have 13. The tool detects this automatically and tells you what it assumed.

SOQL DateTime literals are written in UTC. The moment is the same; only the clock time differs by your time zone offset.

Your device’s time zone, which the page shows next to the result. Everything else on the page is in UTC so it is the same for everyone.

No. Every conversion happens in your browser.

A date alone has no time or zone, so the tool uses the start of that day in UTC, as ISO 8601 recommends. Add a time and offset for a specific moment.