Timestamp Converter Online

Timestamp
0
Milliseconds
0
DateTime
--
ISO 8601
N/A
Timestamp in Milliseconds
N/A
Your Time Zone
N/A
Timestamp
N/A

Convert timestamp to datetime in programming

PHP
$datetime = date('Y-m-d H:i:s', $timestamp);
Java
Date date = new Date(timestamp * 1000L);
Python
import datetime; dt = datetime.datetime.fromtimestamp(timestamp)
JavaScript
const date = new Date(timestamp * 1000);
Pandas
import pandas as pd; dt = pd.to_datetime(timestamp, unit='s')
Ruby
datetime = Time.at(timestamp)
C#
DateTime dateTime = DateTimeOffset.FromUnixTimeSeconds(timestamp).DateTime;
MATLAB
datetime('1970-01-01') + seconds(timestamp)
SQL
SELECT FROM_UNIXTIME(timestamp);
Oracle
SELECT TO_DATE('1970-01-01', 'YYYY-MM-DD') + NUMTODSINTERVAL(timestamp, 'SECOND') FROM DUAL;
Excel
=TEXT(DATE(1970,1,1)+timestamp/86400, "yyyy-mm-dd hh:mm:ss")

What is the unix timestamp

This Unix timestamp converter (epoch converter) turns Unix time into human-readable dates and back, in UTC and in your local time.

The Unix Timestamp, also known as Unix time or POSIX time, is a way to track time as the number of seconds that have elapsed since January 1, 1970, at 00:00:00 UTC. This point in time is called the Unix epoch.

It is a fundamental concept in computing because it provides a simple and consistent way to represent time across different systems and platforms. Unix Timestamps are commonly used for logging events, calculating durations, and synchronizing time across various applications.

Since it is based on UTC, the Unix Timestamp does not account for time zones or daylight saving time changes. To convert a Unix Timestamp to a local time, you need to add or subtract the appropriate time zone offset.

Historically, Unix Timestamps were stored as 32-bit integers, which can only represent dates up to January 19, 2038. Modern systems use 64-bit integers to handle dates far into the future, avoiding the Year 2038 problem.

Many programming languages provide built-in functions to work with Unix Timestamps, making it easy to convert between human-readable dates and Unix time. For example, JavaScript's Date.now() and Python's time.time() both return the current time as a Unix Timestamp.

Why convert the timestamp to human-readable date and time

Timestamps are great for computers, but they don't mean much to us humans.

Converting timestamps to human-readable date and time makes it easier for people to understand when something happened.It helps with things like logging events, scheduling, and displaying dates in user interfaces.Basically, it bridges the gap between how computers store time and how we humans perceive it.

How can I convert a Unix timestamp (epoch) to datetime

1. Converting timestamps in programming languages

2. Use online tool like timestamp.onl to convert

    Type in the timestamps in the input box on website: timestamp.onl

Related converters

Posting a time in a Discord chat? The Discord timestamp generator (<t:> formats) turns any date into a tag that shows in each reader's own time zone. For astronomy and day-of-year dates, use the Julian date converter.

What is the year 2038 problem

The Year 2038 Problem, also known as the Unix Millennium Bug or Y2K38, is a software issue affecting systems that use 32-bit signed integers to represent Unix timestamps.

Unix timestamps count the number of seconds since January 1, 1970, 00:00:00 UTC. A 32-bit signed integer can only store values up to 2,147,483,647, which corresponds to January 19, 2038, at 03:14:07 UTC. After this point, the integer will overflow and reset to a negative value, causing systems to misinterpret the date as December 13, 1901.

This issue could affect a wide range of systems, including embedded devices, operating systems, databases, and financial systems, potentially leading to crashes, errors, and data loss.

Modern systems are transitioning to 64-bit integers, which can handle much larger values and avoid this problem. However, legacy systems and embedded devices may still be at risk.

Organizations are advised to identify vulnerable systems, upgrade to 64-bit representations, and conduct thorough testing to mitigate the impact of the Year 2038 Problem.

Frequently asked questions

How can I convert a Unix timestamp to a date?

Paste the number into the Timestamp to date box at the top of this page. A 10-digit value is read as seconds and a 13-digit value as milliseconds, and the result appears at once as your local time, UTC (GMT) and ISO 8601. In code, JavaScript uses new Date(timestamp * 1000) and Python uses datetime.datetime.fromtimestamp(timestamp).

How do I convert a date to a Unix timestamp?

Open the Date to timestamp tab and type the date as YYYY-MM-DD HH:mm:ss. It is read in your local time zone, and the tool shows the timestamp in seconds and milliseconds, plus the same moment in UTC and ISO 8601. In JavaScript, Math.floor(new Date('2026-01-01T00:00:00Z') / 1000) gives the seconds for a UTC date.

What is the difference between a 10-digit and a 13-digit timestamp?

A 10-digit timestamp counts seconds since 1 January 1970 UTC; a 13-digit one counts milliseconds, which is what JavaScript's Date.now() and Java's System.currentTimeMillis() return. Divide a millisecond value by 1000 to get seconds, or multiply seconds by 1000. This converter detects the length for you.

How do I convert Unix timestamps to dates in Excel?

If the timestamp in seconds is in A1, enter =A1/86400+DATE(1970,1,1) and format the cell as a date and time. For milliseconds, divide by 86400000 instead. The result is in UTC; to shift it to your time zone, add the offset in hours divided by 24, for example +8/24.