Unix Timestamp (Epoch) to Date Converter
Convert Unix timestamps (seconds or milliseconds) to human-readable dates and times in your local timezone or UTC.
Unix time counts seconds since January 1, 1970 UTC.
What is a Unix Timestamp to Date Converter?
A Unix Timestamp to Date Converter transforms Unix timestamps (the number of seconds or milliseconds since January 1, 1970, 00:00:00 UTC, also known as the Unix Epoch) into human-readable dates and times. This conversion is essential for developers working with APIs, databases, or log files that store time data in Unix timestamp format, allowing them to interpret timestamps in a format that's easily understood by humans. You can also use it to find out what date a specific epoch time corresponds to. For reference, the current Unix epoch time is constantly increasing.
Features of Our Unix to Date Converter
Our Unix timestamp conversion tool includes these specific features:
- Convert Unix timestamps in seconds to readable dates
- Automatically detect and handle millisecond timestamps
- Display converted dates with timezone information
- Support for various date display formats
- Copy-to-clipboard functionality for converted dates
How to Use the Unix to Date Converter
- Enter a Unix timestamp in the input field (seconds or milliseconds format)
- Select how the timestamp should be interpreted:
- Local Time: Converts the timestamp to your browser's local timezone.
- UTC: Converts the timestamp to Coordinated Universal Time.
- Click the "Convert to Date" button
- View the resulting human-readable date and time, including the GMT/UTC offset relative to the chosen interpretation.
- Use the copy button to copy the result to your clipboard if needed
The converter will automatically detect whether you've entered a seconds-based or milliseconds-based timestamp based on the number's magnitude. The result will clearly show the input Unix time and the converted time based on your timezone selection.
What is Epoch Time?
The Unix epoch (or Unix time, POSIX time, Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z). Literally speaking, the epoch is Unix time 0 (midnight 1/1/1970), but 'epoch' is often used as a synonym for Unix time. Some systems store epoch dates as a signed 32-bit integer, which might cause problems on January 19, 2038 (known as the Year 2038 problem or Y2K38).
Common time units in seconds:
Human-readable time | Seconds |
---|---|
1 hour | 3600 seconds |
1 day | 86400 seconds |
1 week | 604800 seconds |
1 month (30.44 days) | 2629743 seconds |
1 year (365.24 days) | 31556926 seconds |
How to Get the Current Epoch Time in Various Languages
Here are some examples of how to get the current Unix epoch time (seconds since epoch) in different programming languages:
PHP
time();
Python
import time;
time.time()
Ruby
Time.now.to_i
Perl
time
Java
long epoch = System.currentTimeMillis()/1000;
C#
DateTimeOffset.Now.ToUnixTimeSeconds();
JavaScript
Math.floor(Date.now() / 1000);
Go
import "time"
func main() {
fmt.Println(time.Now().Unix())
}
Swift
NSDate().timeIntervalSince1970
MySQL
SELECT unix_timestamp(now());
PostgreSQL
SELECT extract(epoch from now());
SQLite
SELECT strftime('%s', 'now');
Unix Timestamp Conversion FAQs
What exactly is a Unix timestamp?
A Unix timestamp (also called epoch time) is a way to track time as a running total of seconds since 00:00:00 UTC on January 1, 1970. This point in time is called the Unix epoch. Unix timestamps are widely used in computing because they can represent any point in time as a single integer and are timezone-independent by definition (they always refer to UTC).
How does the timezone choice affect the conversion?
A Unix timestamp inherently represents a moment in UTC. When converting it to a human-readable date, selecting "Local Time" will display this moment according to your browser's timezone settings (e.g., showing your local offset like GMT+0200). Selecting "UTC" will display the date and time directly in UTC (GMT+0000) without any local offset.
How can I tell if my timestamp is in seconds or milliseconds?
Unix timestamps in seconds typically have 10 digits for recent dates (e.g., 1620000000 for May 2021), while millisecond timestamps have 13 digits (e.g., 1620000000000). Our converter automatically detects this based on length and converts appropriately, but you can also tell by the magnitude - if your number is greater than 10 billion, it's likely in milliseconds.