Runs in your browser — nothing you enter leaves this pageRuby 3.x · Rails 7.1–8.1 · Sidekiq 7.x and 8.x payloads
Epoch seconds, milliseconds, microseconds or nanoseconds (negative for before 1970), an ISO 8601 date such as 2026-03-08T07:00:00Z, or "now" for a live clock.

10 digits is seconds, 13 milliseconds, 16 microseconds, 19 nanoseconds.
Defaults to your browser's zone. Dates typed without an offset are read in this zone.

A Unix timestamp counts time since 1970-01-01 00:00:00 UTC. The count is simple, but the unit is not written down: the same instant is 1700000000 in seconds, 1700000000000 in milliseconds and 1700000000000000000 in nanoseconds. Most timestamp bugs come from reading one unit as another, or from formatting the right instant in the wrong zone.

How it works

Type a number, an ISO 8601 date, or now.

The instant is stored as a whole number of nanoseconds (a JavaScript BigInt). A regular number has 53 bits of precision, so 1700000000123456789 would silently become 1700000000123456800. Time zones come from your browser’s Intl data, the same IANA database Rails reads through TZInfo. Nothing is sent anywhere.

The results are the value in all four units, ISO 8601 in UTC and in the chosen zone, the local time, RFC 2822, the HTTP date used in Date and Last-Modified headers, and a relative time such as “3 years ago”.

A worked example: a Sidekiq job payload

Sidekiq 8.0 changed how job timestamps are stored. In 7.x, created_at and enqueued_at are float seconds, such as 1234567890.123456. From 8.0 they are integer milliseconds, such as 1234567890123. The changelog gives the reason: floats lose precision in JSON and in JavaScript.

Paste either value. The first has 10 digits before the decimal point, so it is read as seconds: 2009-02-13T23:31:30.123456Z. The second has 13 digits, so it is read as milliseconds: 2009-02-13T23:31:30.123Z. If you compute queue latency by hand from a payload, now - enqueued_at needs the right unit for your Sidekiq version, or the answer is off by a factor of 1,000. Why background jobs are slow covers how latency is measured.

Ruby and Rails

The snippet panel writes code that reproduces the exact instant, including the sub-second part:

t = Time.at(1700000000, 123, :millisecond).utc
t.iso8601(3)   # => "2023-11-14T22:13:20.123Z"
t.to_i         # => 1700000000

Time.at(1700000000, 123, :millisecond, in: "-05:00")      # core Ruby: an offset
ActiveSupport::TimeZone["America/New_York"].at(1700000000, 123, :millisecond)

Some details matter here:

Every commented result in the panel was checked by running it on Ruby 3.4 with ActiveSupport 8.1.

Limitations

Frequently asked questions

How do I tell seconds from milliseconds?

Count the digits. A present-day timestamp has 10 digits in seconds, 13 in milliseconds, 16 in microseconds and 19 in nanoseconds. The tool reads 1 to 11 digits as seconds, 12 to 14 as milliseconds, 15 to 17 as microseconds and 18 or more as nanoseconds, and says which it chose. Pick a unit to override it.

Why does Time.at(x, in: "America/New_York") raise an error?

In core Ruby the in: keyword takes a fixed offset such as "-05:00", "UTC", a military letter or an integer number of seconds, not a zone name. For a named zone that follows daylight saving, use ActiveSupport: Time.zone.at(x) or ActiveSupport::TimeZone["America/New_York"].at(x).

Can a Unix timestamp be negative?

Yes. A negative value counts back from 1970-01-01 00:00:00 UTC, so -1 is 23:59:59 on 31 December 1969. JavaScript dates reach 8.64e15 milliseconds either side of 1970, about 271,821 BC to 275,760 AD; the tool rejects anything outside that range with a message.

Do leap seconds change the result?

No. Unix time counts every day as exactly 86,400 seconds, so a leap second such as 23:59:60 has no timestamp of its own. The tool rejects :60 in an ISO date and explains why.

Is what I enter sent anywhere?

No. Parsing, time zone conversion and the Ruby snippets are computed in your browser with the built-in Intl time zone data. The page makes no network requests with your input.

Get new articles by email

Deep dives on Rails reliability, when they're published. No spam.