Skip to content

Data tool

Epoch Converter

See the current Unix time, turn any epoch timestamp into a readable date, or turn a date into a timestamp.

Runs entirely in your browser. Nothing you paste is uploaded.

Current Unix epoch time

----------

Reading your device clock…

Epoch to date

Date to epoch

Epoch Converter by YegappanFree tool. Open the full page for the guide.

How to use the Epoch Converter

  1. To read a timestamp, paste it under Epoch to date. Seconds, milliseconds, microseconds and nanoseconds are told apart by their length.
  2. To make a timestamp, pick a date and time under Date to epoch and choose whether it is in your time zone or in UTC.
  3. Select Copy next to any result to copy it.

What epoch time is and how the converter reads it

Epoch time, also called Unix time or a Unix timestamp, is the number of seconds that have passed since 00:00:00 UTC on 1 January 1970, not counting leap seconds. That starting moment is the Unix epoch. Because it is a single number with no time zone attached, the same timestamp means the same instant everywhere, which is why databases, APIs, log files and cookies store time this way.

Systems keep the number at different precision, and the length tells them apart. Today a timestamp in seconds has 10 digits, in milliseconds 13, in microseconds 16 and in nanoseconds 19. JavaScript's Date.now() returns milliseconds, while most Unix tools, PHP's time() and MySQL's UNIX_TIMESTAMP() return seconds. The converter picks the unit from the length, and you can set it yourself when a value could be read two ways.

The result is shown in UTC, in your own time zone as set on your device, and as an ISO 8601 string, the format most APIs accept. Going the other way, a date and time become a timestamp in seconds and in milliseconds, along with the first and last second of that day, which is what a date-range query needs.

The year 2038 problem affects systems that keep the timestamp in a signed 32-bit integer. The largest value such a field can hold is 2,147,483,647, which is 03:14:07 UTC on 19 January 2038. One second later the number overflows. Systems that use 64-bit integers are not affected.

Epoch time in code

How to get the current epoch time in seconds, and how to turn a timestamp back into a date, in the languages and databases people ask about most. The examples use 1800000000, which is 15 January 2027, 08:00:00 UTC.

LanguageCurrent epoch timeTimestamp to date
JavaScriptMath.floor(Date.now() / 1000)new Date(1800000000 * 1000).toISOString()
Pythonimport time; int(time.time())datetime.fromtimestamp(1800000000, tz=timezone.utc)
PHPtime()gmdate('Y-m-d H:i:s', 1800000000)
JavaInstant.now().getEpochSecond()Instant.ofEpochSecond(1800000000L)
C#DateTimeOffset.UtcNow.ToUnixTimeSeconds()DateTimeOffset.FromUnixTimeSeconds(1800000000)
Gotime.Now().Unix()time.Unix(1800000000, 0).UTC()
RubyTime.now.to_iTime.at(1800000000).utc
Linux shelldate +%sdate -u -d @1800000000
macOS shelldate +%sdate -u -r 1800000000
MySQLSELECT UNIX_TIMESTAMP();SELECT FROM_UNIXTIME(1800000000);
PostgreSQLSELECT EXTRACT(EPOCH FROM now())::bigint;SELECT to_timestamp(1800000000);
SQLiteSELECT strftime('%s', 'now');SELECT datetime(1800000000, 'unixepoch');
Excel and Google Sheets=(NOW()-DATE(1970,1,1))*86400=A1/86400+DATE(1970,1,1)

JavaScript and Java work in milliseconds by default, so multiply a timestamp in seconds by 1000 before making a date from it. The spreadsheet formulas use the sheet's own time zone: NOW() is local time, so the first formula is exact only when the sheet is set to UTC.

Common lengths of time in seconds

Length of timeSecondsMilliseconds
1 minute6060000
1 hour36003600000
1 day8640086400000
1 week604800604800000
30 days25920002592000000
365 days3153600031536000000

Timestamps worth knowing

TimestampDate in UTCWhy it matters
01 Jan 1970, 00:00:00The Unix epoch itself
10000000009 Sep 2001, 01:46:40The first 10-digit timestamp
123456789013 Feb 2009, 23:31:30The digits run in order
200000000018 May 2033, 03:33:20The next round billion
214748364719 Jan 2038, 03:14:07The largest signed 32-bit value

Common questions

How do I convert a Unix timestamp to a date?

Paste the timestamp under Epoch to date. The converter shows the date in UTC, in your own time zone and as an ISO 8601 string.

What is an epoch timestamp?

It is the number of seconds since 00:00:00 UTC on 1 January 1970. The same number describes the same instant in every time zone.

How do I know if a timestamp is in seconds or milliseconds?

Count the digits. A current timestamp in seconds has 10 digits and one in milliseconds has 13. The converter reads the length and tells you which unit it used.

Does an epoch timestamp have a time zone?

No. It always counts from midnight UTC. A time zone only matters when the number is shown as a date, so the converter shows both UTC and your local time.

Why is my date off by a few hours?

The timestamp was probably made from a local time but read as UTC, or the other way round. Check the Read as setting under Date to epoch, and compare the UTC and local lines in the result.

Can it convert dates before 1970?

Yes. Dates before 1 January 1970 have negative timestamps. Enter a negative number, or pick an earlier date.

What is the year 2038 problem?

A signed 32-bit integer cannot count past 2,147,483,647 seconds, which is reached at 03:14:07 UTC on 19 January 2038. Software that still stores time that way will misread dates after that moment.

Are my timestamps sent anywhere?

No. The conversion runs in your browser, using your device's clock and time zone.

Guides for the Epoch Converter

Related tools