Date to Unix Timestamp – Date and Time to Epoch Converter

Content last reviewed:

Enter a date with a time and read the Unix timestamp in seconds. Midnight UTC on January 1, 2025 is the timestamp 1735689600. The same moment in milliseconds appears under the result, and with the Local time option the time you enter is read in your device's time zone.

UTC

Enter a date as 2023-11-14 22:13:20 or 14.11.2023 22:13. ISO 8601 with a zone, such as 2023-11-14T22:13:20Z, is accepted too.

s
Time zone

With UTC the time you enter is read with no offset. With local time it is read in the time zone set on your device. A date that carries its own zone, such as +02:00, is read in that zone.

to

What is a Unix timestamp, and where does it start?

A Unix timestamp is Unix time written as a single number: the count of seconds since the start of 1970 in UTC[1]. Midnight on January 1, 1970 has the timestamp 0, and the timestamp goes up by one with every second after that.

POSIX, the shared standard for Unix-like systems, gives the formula for the timestamp of a date. The formula adds up the seconds, the minutes times 60, the hours times 3,600 and the days times 86,400, with a correction for leap years[2]. Every day in this calculation has exactly 86,400 seconds.

A date written for people always assumes some time zone, while the timestamp itself holds no time zone information[3]. That is why 10:00 AM on a clock in New York and 10:00 AM on a clock in London give two different timestamps.

How do you convert a date to a Unix timestamp?

Midnight UTC on January 1, 2025 is the Unix timestamp 1735689600. Midnight on the same day in New York came five hours later, because Eastern Standard Time is five hours behind UTC[4]. Its timestamp is 1735707600.

To get the timestamp of any date, enter it in the Date and time field, for example 2025-01-01 00:00:00 or 2025/01/01 00:00. The result in seconds appears in the Unix Timestamp field. Below it, the converter gives the same moment in milliseconds, the unit in which Date.now() returns the time in JavaScript[5].

The converter reads a date without a zone as UTC. If you enter a time from a clock in New York or London, choose Local time in the Time zone switch. The converter then reads the time in your device's time zone, with daylight saving time taken into account.

A date with an offset added, such as 2025-01-01T00:00:00-05:00, is read with that offset under both options.

Copy the result with the Copy result button.

How do you calculate the Unix timestamp for a date? Formula and example

The timestamp is the number of full days since January 1, 1970, multiplied by 86,400, plus the seconds that have passed since midnight on that day[2].

Take November 14, 2023, at 22:13:20 UTC. From January 1, 1970 to that day, 19,675 full days passed. Multiplying by 86,400 gives 1699920000 seconds.

The time 22:13:20 is 80,000 seconds after midnight. Adding the two numbers gives the timestamp 1700000000.

Convert a date written in New York time to UTC first. In winter you add five hours, or 18,000 seconds. During daylight saving time you add four hours, or 14,400 seconds[4]. Midnight on January 1, 2025 in New York is therefore 1735689600 plus 18,000, which is 1735707600. For a time during British Summer Time in the UK, you subtract 3,600 seconds[6].

The Unix timestamp to date converter turns the result back into a date. If a system expects the timestamp in hexadecimal, convert the result in the decimal to hex converter. The timestamp 1700000000 is 6553F100 in hexadecimal.

January 2021 calendar page next to a potted plant and a small clock
January 2021 began on a Friday. Midnight UTC on January 1, 2021 is the Unix timestamp 1609459200. Photo: Debby Hudson, Unsplash.

What is the Unix timestamp for January 1 of each year?

Each row is for midnight on January 1. The Midnight UTC column gives the timestamp of that moment in UTC, and the milliseconds column gives the same moment in the JavaScript unit. The Midnight in New York column gives the timestamp for midnight on a New York clock, which shows Eastern Standard Time on January 1, five hours behind UTC[4].
YearMidnight UTCMidnight UTC in millisecondsMidnight in New York
2000946684800946684800000946702800 (UTC-5)
2001978307200978307200000978325200 (UTC-5)
2002100984320010098432000001009861200 (UTC-5)
2003104137920010413792000001041397200 (UTC-5)
2004107291520010729152000001072933200 (UTC-5)
2005110453760011045376000001104555600 (UTC-5)
2006113607360011360736000001136091600 (UTC-5)
2007116760960011676096000001167627600 (UTC-5)
2008119914560011991456000001199163600 (UTC-5)
2009123076800012307680000001230786000 (UTC-5)
2010126230400012623040000001262322000 (UTC-5)
2011129384000012938400000001293858000 (UTC-5)
2012132537600013253760000001325394000 (UTC-5)
2013135699840013569984000001357016400 (UTC-5)
2014138853440013885344000001388552400 (UTC-5)
2015142007040014200704000001420088400 (UTC-5)
2016145160640014516064000001451624400 (UTC-5)
2017148322880014832288000001483246800 (UTC-5)
2018151476480015147648000001514782800 (UTC-5)
2019154630080015463008000001546318800 (UTC-5)
2020157783680015778368000001577854800 (UTC-5)
2021160945920016094592000001609477200 (UTC-5)
2022164099520016409952000001641013200 (UTC-5)
2023167253120016725312000001672549200 (UTC-5)
2024170406720017040672000001704085200 (UTC-5)
2025173568960017356896000001735707600 (UTC-5)
2026176722560017672256000001767243600 (UTC-5)
2027179876160017987616000001798779600 (UTC-5)
2028183029760018302976000001830315600 (UTC-5)
2029186192000018619200000001861938000 (UTC-5)
2030189345600018934560000001893474000 (UTC-5)
2031192499200019249920000001925010000 (UTC-5)
2032195652800019565280000001956546000 (UTC-5)
2033198815040019881504000001988168400 (UTC-5)
2034201968640020196864000002019704400 (UTC-5)
2035205122240020512224000002051240400 (UTC-5)
2036208275840020827584000002082776400 (UTC-5)
2037211438080021143808000002114398800 (UTC-5)
2038214591680021459168000002145934800 (UTC-5)
2039217745280021774528000002177470800 (UTC-5)
2040220898880022089888000002209006800 (UTC-5)
The timestamp for the start of 2038, 2145916800, still fits in a 32-bit signed integer. The last second such an integer can hold is January 19, 2038, at 03:14:07 UTC[1]. You can see that limit in binary, as thirty-one ones, in the decimal to binary converter.

What Unix timestamps mark the 2026 clock changes in New York and London?

In 2026, daylight saving time in the US runs from March 8 at 2 AM to November 1 at 2 AM local time[7]. In the UK, clocks go forward on March 29 and back on October 25[6]. The table gives the timestamps on both sides of each change in New York and the first second after each change in London.
MomentClock timeUnix timestamp
New York, last second of standard timeMarch 8, 2026, 1:59:59 AM EST1772953199
New York, first second of daylight saving timeMarch 8, 2026, 3:00:00 AM EDT1772953200
New York, first 1:30 AM in NovemberNovember 1, 2026, 1:30:00 AM EDT1793511000
New York, last second of daylight saving timeNovember 1, 2026, 1:59:59 AM EDT1793512799
New York, first second of standard timeNovember 1, 2026, 1:00:00 AM EST1793512800
New York, second 1:30 AM in NovemberNovember 1, 2026, 1:30:00 AM EST1793514600
London, first second of British Summer TimeMarch 29, 2026, 2:00:00 AM BST1774746000
London, first second of Greenwich Mean TimeOctober 25, 2026, 1:00:00 AM GMT1792890000
The hour from 1:00 to 1:59 AM happens twice in New York on November 1, so 1:30 AM has two timestamps that day. On a device set to New York time, the entry 2026-11-01 01:30:00 with the Local time option gives the earlier one, 1793511000. Paste any timestamp from the table into the Unix timestamp to date converter to see its date in UTC.

Which formula converts a date to a Unix timestamp in Excel, SQL and code?

Each row turns November 14, 2023, 22:13:20 UTC into the timestamp 1700000000. We checked the Python and JavaScript results for this date.
WhereFormula or expressionResult
Excel=(A1-DATE(1970,1,1))*864001700000000 for the date 2023-11-14 22:13:20 in cell A1
Excel, result in milliseconds=(A1-DATE(1970,1,1))*864000001700000000000
Google Sheets=(A1-DATE(1970,1,1))*864001700000000
MySQLSELECT UNIX_TIMESTAMP('2023-11-14 22:13:20');1700000000 when the session time zone is UTC
PostgreSQLSELECT EXTRACT(EPOCH FROM TIMESTAMPTZ '2023-11-14 22:13:20+00');1700000000.000000
Pythondatetime(2023, 11, 14, 22, 13, 20, tzinfo=timezone.utc).timestamp()1700000000.0
JavaScriptDate.UTC(2023, 10, 14, 22, 13, 20) / 10001700000000
JavaScript, result in millisecondsDate.UTC(2023, 10, 14, 22, 13, 20)1700000000000
MySQL reads the date given to UNIX_TIMESTAMP in the session time zone, which is the zone set for the current connection[8]. In PostgreSQL, EXTRACT(EPOCH FROM …) for a timestamp with time zone value counts the seconds since 1970-01-01 00:00:00 UTC[9]. Date.UTC in JavaScript counts months from zero, so November is month 10[10]. In Python, the timestamp() method of a datetime object with the UTC zone returns the seconds since the epoch, and an object without a zone is treated as local time[11].

How do you convert a date to a Unix timestamp in Excel and Google Sheets?

For a single date, the field above is faster. A spreadsheet converts a whole column of dates to timestamps with one formula dragged down.

  1. Excel: the date difference times 86,400

    Enter a date with a time in cell A1 and the formula =(A1-DATE(1970,1,1))*86400 in cell B1. Excel stores dates as sequential serial numbers of days[12], so the difference between two dates is a number of days. Multiplying by 86,400 turns those days into seconds.
  2. Excel: a number format in the result cell

    If cell B1 shows the result as a date, give it the Number format with no decimal places. You then see 1700000000.
  3. Dates in New York or UK time

    The formula treats the date in cell A1 as UTC. If you enter a time from a New York clock, add 18,000 seconds to the result for a date in standard time or 14,400 seconds for a date in daylight saving time[4]. For a date during British Summer Time, subtract 3,600 seconds[6].
  4. Google Sheets: the same formula

    In Google Sheets, the DATE function takes the arguments year, month and day[13]. The formula =(A1-DATE(1970,1,1))*86400 therefore works the same way as in Excel.
  5. Excel: workbooks that use the 1904 date system

    A workbook can count dates from January 1, 1904 instead of January 1, 1900, and the two systems differ by 1,462 days[14]. The formula subtracts January 1, 1970 as counted in the same workbook's system, so it gives the same timestamp in both systems.

Which Unix timestamp does a time on a clock-change day get?

On the first Sunday of November, daylight saving time in the US ends at 2:00 AM[7], and clocks go back to 1:00 AM standard time. Every time from 1:00 to 1:59 AM then happens twice, so each of those times matches two timestamps.

In that case the converter, with the Local time option, picks the earlier of the two moments, as the JavaScript Date object does[15]. To get the second moment, one hour later, add the offset to the date. The entry 2026-11-01 01:30:00 -05:00 gives the timestamp 1793514600. On a device set to New York time, you can see both moments as local times when you paste these timestamps into the Unix timestamp to date converter and choose Local time.

On the second Sunday of March, daylight saving time begins at 2:00 AM[7], and clocks jump straight to 3:00 AM. The time 2:30 AM does not appear on US clocks that day. The converter moves such an entry one hour forward, as Date does[15], and gives the timestamp for 3:30 AM daylight saving time.

In the UK, clocks go forward at 1 AM on the last Sunday of March and back at 2 AM on the last Sunday of October[6], so London has the same two situations on those days. With the UTC option, every time you enter has exactly one timestamp, because UTC does not switch to daylight saving time.

Five wall clocks labeled Sídney, Londres, Monterrey, Vancouver and New York
Each of these clocks shows the time of a different city. Enter a time read from one of them with the Local time option on a device set to that city's time zone, or add the zone offset to the date. Photo: Luis Cortes, Unsplash.

Sources

  1. Unix timeWikipedia
  2. The Open Group Base Specifications Issue 8 (POSIX.1-2024), 4.19 Seconds Since the EpochThe Open Group
  3. time — PHP ManualThe PHP Group
  4. Eastern Time ZoneWikipedia
  5. Date.now()MDN Web Docs
  6. When do the clocks change?GOV.UK
  7. Daylight Saving Time RulesNational Institute of Standards and Technology
  8. MySQL 8.4 Reference Manual, Date and Time FunctionsOracle
  9. PostgreSQL Documentation, Date/Time Functions and OperatorsPostgreSQL Global Development Group
  10. Date.UTC()MDN Web Docs
  11. datetime — Basic date and time typesPython Software Foundation
  12. DATE functionMicrosoft Support
  13. DATEGoogle Docs Editors Help
  14. Date systems in ExcelMicrosoft Support
  15. Temporal.ZonedDateTime, Ambiguity and gaps from offset transitionsMDN Web Docs
  16. RFC 7519: JSON Web Token (JWT)IETF
  17. Resolution 4 of the 27th CGPM (2022): On the use and future development of UTCBureau International des Poids et Mesures

Every figure in the tables was computed from the unit definitions and checked arithmetically before publication. Historical values and the names of local units come from the sources listed above.

Content last reviewed: · written and checked by the Arteon team

Frequently asked questions about converting dates to Unix timestamps

How do I get the Unix timestamp for midnight today in my time zone?

Enter today's date without a time, as YYYY-MM-DD, and choose Local time in the Time zone switch. A date without a time means midnight, and the Local time option reads it in your device's time zone. With the UTC option, the same entry gives midnight UTC.

How do I convert a date to a Unix timestamp in milliseconds?

The converter gives the same moment in milliseconds under the result. That value is the timestamp in seconds multiplied by 1,000. Date.UTC in JavaScript also returns its result in milliseconds[10].

What Unix timestamp goes into the exp claim of a JWT?

The exp claim holds the number of seconds since January 1, 1970 UTC and marks the time on or after which the token must not be accepted[16]. Enter the expiration date and time in the converter, and put the result from the Unix Timestamp field into exp. A token valid for one hour after it was issued has an exp value 3,600 greater than its iat value. To read the expiration date of an existing token, use the Unix timestamp to date converter.

Why is November month 10 in Date.UTC?

Date.UTC counts months from zero: January is 0 and December is 11[10]. The day of the month, hours, minutes and seconds keep their usual values. November 14, 2023 is therefore written as Date.UTC(2023, 10, 14).

What is the latest date a 32-bit Unix timestamp can store?

The last moment a 32-bit signed integer can store is January 19, 2038, at 03:14:07 UTC[1]. In MySQL on 64-bit platforms, UNIX_TIMESTAMP accepts dates up to January 19, 3001, and returns 0 for a date outside that range[8].

Can I enter 23:59:60 with a leap second?

The converter accepts seconds from 00 to 59, because every day in Unix time has exactly 86,400 seconds[2]. In 2022 the General Conference on Weights and Measures decided that the maximum allowed difference between the UT1 and UTC time scales will be increased no later than 2035[17].

How do I enter a date with a specific time zone?

Add the zone offset to the date, for example 2023-11-14 17:13:20 -05:00, or add Z, UTC or GMT. You can also write the offset without a colon, as -0500. A date with its own zone is read in that zone under both options of the switch.

How should I enter a date with slashes?

Put the year first, as in 2023/11/14. In the US, 11/12/2023 means November 12, and in the UK it means 11 December, while a date that starts with the year means the same day in both. For a date with the year at the end, use periods: 14.11.2023.

How do I convert a Unix timestamp back to a date?

Click Swap order. The Unix timestamp to date converter opens with the timestamp from the Unix Timestamp field already entered. That converter also accepts values in milliseconds, microseconds and nanoseconds.

Arteon free tool screenshot: Date to Unix Timestamp – Date and Time to Epoch Converter

Help us improve our tools

Have an idea, found a bug, or want to suggest a feature? Drop us a message – we respond within 24 hours.