Timestamp to Date
Supports seconds, milliseconds, microseconds and nanoseconds
UTC Time:
Local Time:
Convert Unix timestamps to human-readable dates and vice versa instantly. Free online epoch converter with real-time conversion, timezone support, and code examples in 8+ programming languages. Professional tool for developers and system administrators.
Thursday, December 11th 2025, 8:40:22 PM
Supports seconds, milliseconds, microseconds and nanoseconds
UTC Time:
Local Time:
Unix Timestamp:
Milliseconds:
| Time Period | Seconds | Minutes | Hours |
|---|---|---|---|
| 1 Minute | 60 | 1 | 0.017 |
| 1 Hour | 3,600 | 60 | 1 |
| 1 Day | 86,400 | 1,440 | 24 |
| 1 Week | 604,800 | 10,080 | 168 |
| 1 Month (30.44 days) | 2,629,744 | 43,829.067 | 730.484 |
| 1 Year (365.24 days) | 31,556,926 | 525,948.767 | 8,765.813 |
// Convert human-readable date to Unix timestamp
strtotime("December 11, 2025");
// Result: 1765478422
// Alternative formats
strtotime("12/11/2025");
strtotime("+10 days"); // 10 days from now
// Object-oriented approach
$date = new DateTime('12/11/2025');
echo $date->format('U'); // Unix timestamp
// With timezone
$date = new DateTime('12/11/2025', new DateTimeZone('UTC'));
$timestamp = $date->getTimestamp();// Convert date string to Unix timestamp
const myDate = new Date("December 11, 2025 20:40:22");
const myEpoch = Math.floor(myDate.getTime() / 1000);
console.log(myEpoch); // 1765478422
// Using Date.parse()
const timestamp = Math.floor(Date.parse("2025-12-11") / 1000);
// From individual components
const date = new Date(2025, 11, 11, 20, 40, 22);
const epoch = Math.floor(date.getTime() / 1000);
// Current timestamp
const now = Math.floor(Date.now() / 1000);import calendar
import time
from datetime import datetime
# Convert date string to Unix timestamp
date_string = '2025-12-11 20:40:22'
timestamp = calendar.timegm(time.strptime(date_string, '%Y-%m-%d %H:%M:%S'))
print(timestamp) # 1765478422
# Using datetime module
dt = datetime(2025, 12, 11, 20, 40, 22)
timestamp = int(dt.timestamp())
# Current timestamp
import time
current_timestamp = int(time.time())import java.time.*;
import java.time.format.DateTimeFormatter;
// Convert date string to Unix timestamp
String dateString = "2025-12-11 20:40:22";
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime dateTime = LocalDateTime.parse(dateString, formatter);
long timestamp = dateTime.atZone(ZoneId.of("UTC")).toEpochSecond();
System.out.println(timestamp); // 1765478422
// From individual components
LocalDateTime dt = LocalDateTime.of(2025, 12, 11, 20, 40, 22);
long epochSecond = dt.toEpochSecond(ZoneOffset.UTC);
// Current timestamp
long currentTimestamp = Instant.now().getEpochSecond();using System;
// Convert DateTime to Unix timestamp
DateTime dateTime = new DateTime(2025, 12, 11, 20, 40, 22, DateTimeKind.Utc);
long timestamp = ((DateTimeOffset)dateTime).ToUnixTimeSeconds();
Console.WriteLine(timestamp); // 1765478422
// From string
DateTime parsedDate = DateTime.Parse("2025-12-11 20:40:22");
long unixTime = ((DateTimeOffset)parsedDate.ToUniversalTime()).ToUnixTimeSeconds();
// Current timestamp
long currentTimestamp = DateTimeOffset.Now.ToUnixTimeSeconds();
// Alternative using TimeSpan
DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
long timestamp2 = (long)(dateTime - epoch).TotalSeconds;package main
import (
"fmt"
"time"
)
func main() {
// Convert date to Unix timestamp
layout := "2006-01-02 15:04:05"
dateString := "2025-12-11 20:40:22"
t, _ := time.Parse(layout, dateString)
timestamp := t.Unix()
fmt.Println(timestamp) // 1765478422
// From individual components
date := time.Date(2025, time.Month(12), 11, 20, 40, 22, 0, time.UTC)
unixTime := date.Unix()
// Current timestamp
currentTimestamp := time.Now().Unix()
fmt.Println(currentTimestamp)
}import Foundation
// Convert date string to Unix timestamp
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
dateFormatter.timeZone = TimeZone(abbreviation: "UTC")
if let date = dateFormatter.date(from: "2025-12-11 20:40:22") {
let timestamp = Int(date.timeIntervalSince1970)
print(timestamp) // 1765478422
}
// From Date components
let calendar = Calendar.current
let components = DateComponents(year: 2025, month: 12, day: 11,
hour: 20, minute: 40, second: 22)
if let date = calendar.date(from: components) {
let unixTime = Int(date.timeIntervalSince1970)
}
// Current timestamp
let currentTimestamp = Int(Date().timeIntervalSince1970)use chrono::{DateTime, Utc, NaiveDateTime, TimeZone};
// Convert date string to Unix timestamp
let date_str = "2025-12-11 20:40:22";
let naive_dt = NaiveDateTime::parse_from_str(date_str, "%Y-%m-%d %H:%M:%S").unwrap();
let dt: DateTime<Utc> = Utc.from_utc_datetime(&naive_dt);
let timestamp = dt.timestamp();
println!("{}", timestamp); // 1765478422
// From individual components
let dt = Utc.ymd(2025, 12, 11).and_hms(20, 40, 22);
let unix_time = dt.timestamp();
// Current timestamp
let now = Utc::now();
let current_timestamp = now.timestamp();
// Using std::time
use std::time::{SystemTime, UNIX_EPOCH};
let duration = SystemTime::now().duration_since(UNIX_EPOCH).unwrap();
let timestamp_std = duration.as_secs();// Convert Unix timestamp to human-readable date
$epoch = 1765478422;
$dt = new DateTime("@$epoch");
echo $dt->format('Y-m-d H:i:s'); // 2025-12-11 20:40:22
// With timezone
$dt->setTimezone(new DateTimeZone('America/New_York'));
echo $dt->format('Y-m-d H:i:s T');
// Using date() function
echo date('Y-m-d H:i:s', $epoch);
echo date('l, F j, Y g:i A', $epoch); // Full format
// Different formats
echo date('c', $epoch); // ISO 8601 format
echo date('r', $epoch); // RFC 2822 format// Convert Unix timestamp to Date object
const timestamp = 1765478422;
const myDate = new Date(timestamp * 1000);
console.log(myDate.toString());
// Thu Dec 11 2025 20:40:22 GMT+0200
// Custom formatting
const year = myDate.getFullYear();
const month = String(myDate.getMonth() + 1).padStart(2, '0');
const day = String(myDate.getDate()).padStart(2, '0');
const formatted = `${year}-${month}-${day}`;
// Using toLocaleString for different formats
console.log(myDate.toLocaleString()); // Local format
console.log(myDate.toISOString()); // ISO format
console.log(myDate.toUTCString()); // UTC format
// Custom locale formatting
const options = { year: 'numeric', month: 'long', day: 'numeric', hour: '2-digit', minute: '2-digit' };
console.log(myDate.toLocaleDateString('en-US', options));import time
from datetime import datetime, timezone
# Convert Unix timestamp to human-readable date
timestamp = 1765478422
dt = datetime.fromtimestamp(timestamp, tz=timezone.utc)
print(dt.strftime('%Y-%m-%d %H:%M:%S')) # 2025-12-11 20:40:22
# Using time module
formatted_time = time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime(timestamp))
print(formatted_time)
# Different formats
print(dt.strftime('%B %d, %Y at %I:%M %p')) # Full format
print(dt.isoformat()) # ISO format
print(dt.strftime('%A, %B %d, %Y')) # Day and date
# Local timezone
local_dt = datetime.fromtimestamp(timestamp)
print(f"Local time: {local_dt.strftime('%Y-%m-%d %H:%M:%S')}")import java.time.*;
import java.time.format.DateTimeFormatter;
// Convert Unix timestamp to LocalDateTime
long timestamp = 1765478422L;
Instant instant = Instant.ofEpochSecond(timestamp);
LocalDateTime dateTime = LocalDateTime.ofInstant(instant, ZoneOffset.UTC);
System.out.println(dateTime); // 2025-12-11T20:40:22
// Custom formatting
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
String formatted = dateTime.format(formatter);
System.out.println(formatted);
// Different time zones
ZonedDateTime nyTime = instant.atZone(ZoneId.of("America/New_York"));
ZonedDateTime londonTime = instant.atZone(ZoneId.of("Europe/London"));
// Various formats
DateTimeFormatter fullFormatter = DateTimeFormatter.ofPattern("EEEE, MMMM d, yyyy 'at' h:mm a");
System.out.println(dateTime.format(fullFormatter));using System;
// Convert Unix timestamp to DateTime
long timestamp = 1765478422;
DateTime dateTime = DateTimeOffset.FromUnixTimeSeconds(timestamp).DateTime;
Console.WriteLine(dateTime.ToString("yyyy-MM-dd HH:mm:ss")); // 2025-12-11 20:40:22
// With timezone info
DateTimeOffset dto = DateTimeOffset.FromUnixTimeSeconds(timestamp);
Console.WriteLine(dto.ToString("yyyy-MM-dd HH:mm:ss zzz"));
// Different formats
Console.WriteLine(dateTime.ToString("F")); // Full date/time
Console.WriteLine(dateTime.ToString("D")); // Long date
Console.WriteLine(dateTime.ToString("T")); // Long time
// Custom format
string customFormat = dateTime.ToString("dddd, MMMM dd, yyyy 'at' h:mm tt");
Console.WriteLine(customFormat);
// UTC conversion
DateTime utcDateTime = dateTime.ToUniversalTime();# Convert Unix timestamp to Time object
timestamp = 1765478422
time = Time.at(timestamp).utc
puts time.strftime('%Y-%m-%d %H:%M:%S') # 2025-12-11 20:40:22
# Different formats
puts time.strftime('%A, %B %d, %Y at %I:%M %p') # Full format
puts time.strftime('%c') # Complete date and time
puts time.iso8601 # ISO 8601 format
# Local timezone
local_time = Time.at(timestamp)
puts "Local: #{local_time.strftime('%Y-%m-%d %H:%M:%S %Z')}"
# Using DateTime
require 'date'
dt = DateTime.strptime(timestamp.to_s, '%s')
puts dt.strftime('%Y-%m-%d %H:%M:%S')import java.time.*
import java.time.format.DateTimeFormatter
// Convert Unix timestamp to LocalDateTime
val timestamp = 1765478422L
val instant = Instant.ofEpochSecond(timestamp)
val dateTime = LocalDateTime.ofInstant(instant, ZoneOffset.UTC)
println(dateTime) // 2025-12-11T20:40:22
// Custom formatting
val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
val formatted = dateTime.format(formatter)
println(formatted)
// Different time zones
val nyTime = instant.atZone(ZoneId.of("America/New_York"))
val londonTime = instant.atZone(ZoneId.of("Europe/London"))
// Using extension functions
fun Long.toLocalDateTime(): LocalDateTime =
LocalDateTime.ofInstant(Instant.ofEpochSecond(this), ZoneOffset.UTC)
val dt = timestamp.toLocalDateTime()
println("Formatted: ${dt.format(formatter)}")#!/usr/bin/perl
use strict;
use warnings;
use POSIX qw(strftime);
# Convert Unix timestamp to human-readable date
my $timestamp = 1765478422;
my $formatted = strftime("%Y-%m-%d %H:%M:%S", gmtime($timestamp));
print "$formatted\n"; # 2025-12-11 20:40:22
# Different formats
print strftime("%A, %B %d, %Y at %I:%M %p", gmtime($timestamp)) . "\n";
print strftime("%c", gmtime($timestamp)) . "\n"; # Complete format
# Local time
my $local_formatted = strftime("%Y-%m-%d %H:%M:%S %Z", localtime($timestamp));
print "Local: $local_formatted\n";
# Using DateTime module (if available)
use DateTime;
my $dt = DateTime->from_epoch(epoch => $timestamp);
print $dt->strftime('%Y-%m-%d %H:%M:%S') . "\n";Unix timestamp (also known as Epoch time or POSIX time) is a system for tracking time as a running total of seconds since January 1, 1970, 00:00:00 UTC. This date is called the "Unix Epoch."
Used across all computing platforms and programming languages for consistent time representation.
Simple arithmetic operations for time differences, comparisons, and scheduling.
Represents a single moment in time regardless of location or timezone.
32-bit systems will face an overflow issue on January 19, 2038, at 03:14:07 UTC. Modern 64-bit systems have resolved this limitation.
Unix timestamp is a single number representing seconds since January 1, 1970, making it universal and timezone-independent. Other formats like ISO 8601 are human-readable but more complex to process programmatically.
Divide the milliseconds by 1000. For example: 1609459200000 ÷ 1000 = 1609459200 Unix timestamp (January 1, 2021).
Unix timestamps are always in UTC. If you see a different time, it's likely being displayed in your local timezone. Always consider timezone conversions when working with timestamps.
Yes, negative Unix timestamps represent dates before January 1, 1970. For example: -86400 represents December 31, 1969.
All major programming languages support Unix timestamps including JavaScript, Python, PHP, Java, C#, Go, Ruby, Swift, Rust, and Kotlin. Each language provides built-in functions to convert between Unix timestamps and human-readable dates.
No, Unix timestamps are always in UTC and are not affected by daylight saving time or timezone changes. The timestamp represents an absolute point in time, making it reliable for global applications.