Convertisseur et détecteur de timestamps Unix — Convertissez, comparez et détectez les timestamps en temps réel

Timestamp Unix
—

Chargement du timestamp en temps réel...

CopierPauseActualiserColler
Convertisseur rapide

Collez un timestamp Unix ou une date pour convertir instantanément entre secondes Unix, millisecondes, ISO 8601, UTC, heure localisée et temps relatif.

Fuseaux horaires mondiaux

Comparez l’heure actuelle dans plus de 40 fuseaux horaires avec un format localisé.

Exemples de code timestamp

Obtenez, formatez, analysez et convertissez des timestamps Unix dans les langages populaires.

// Current Unix timestamp (seconds)
const now = Math.floor(Date.now() / 1000);

// Current timestamp in milliseconds
const ms = Date.now();

// Convert timestamp to Date object
const date = new Date(1710492223 * 1000);

// Format to ISO 8601 string
date.toISOString(); // "2024-03-15T12:23:43.000Z"

// Format to locale string
date.toLocaleString("en-US", {
  timeZone: "America/New_York",
  dateStyle: "full",
  timeStyle: "long",
});

// Parse a date string to timestamp
const ts = new Date("2024-03-15T08:00:00Z").getTime() / 1000;

// Add 7 days to a timestamp
const nextWeek = now + 7 * 24 * 60 * 60;

// Compare two timestamps
const isExpired = now > expiresAt;

// Get individual components
const year = date.getFullYear();
const month = date.getMonth() + 1; // 0-indexed
const day = date.getDate();
const hours = date.getHours();
// Current Unix timestamp (seconds)
const now = Math.floor(Date.now() / 1000);

// Current timestamp in milliseconds
const ms = Date.now();

// Convert timestamp to Date object
const date = new Date(1710492223 * 1000);

// Format to ISO 8601 string
date.toISOString(); // "2024-03-15T12:23:43.000Z"

// Format to locale string
date.toLocaleString("en-US", {
  timeZone: "America/New_York",
  dateStyle: "full",
  timeStyle: "long",
});

// Parse a date string to timestamp
const ts = new Date("2024-03-15T08:00:00Z").getTime() / 1000;

// Add 7 days to a timestamp
const nextWeek = now + 7 * 24 * 60 * 60;

// Compare two timestamps
const isExpired = now > expiresAt;

// Get individual components
const year = date.getFullYear();
const month = date.getMonth() + 1; // 0-indexed
const day = date.getDate();
const hours = date.getHours();
import time
from datetime import datetime, timezone, timedelta

# Current Unix timestamp (seconds)
now = int(time.time())

# Current timestamp in milliseconds
ms = int(time.time() * 1000)

# Convert timestamp to datetime
dt = datetime.fromtimestamp(1710492223, tz=timezone.utc)

# Format to ISO 8601
dt.isoformat()  # "2024-03-15T12:23:43+00:00"

# Custom format with strftime
dt.strftime("%Y-%m-%d %H:%M:%S")  # "2024-03-15 12:23:43"
dt.strftime("%B %d, %Y %I:%M %p")  # "March 15, 2024 12:23 PM"

# Parse a date string to timestamp
parsed = datetime.strptime("2024-03-15 08:00:00", "%Y-%m-%d %H:%M:%S")
ts = int(parsed.replace(tzinfo=timezone.utc).timestamp())

# Add 7 days
next_week = dt + timedelta(days=7)

# Convert between timezones
eastern = dt.astimezone(timezone(timedelta(hours=-5)))

# Get individual components
year, month, day = dt.year, dt.month, dt.day
import time
from datetime import datetime, timezone, timedelta

# Current Unix timestamp (seconds)
now = int(time.time())

# Current timestamp in milliseconds
ms = int(time.time() * 1000)

# Convert timestamp to datetime
dt = datetime.fromtimestamp(1710492223, tz=timezone.utc)

# Format to ISO 8601
dt.isoformat()  # "2024-03-15T12:23:43+00:00"

# Custom format with strftime
dt.strftime("%Y-%m-%d %H:%M:%S")  # "2024-03-15 12:23:43"
dt.strftime("%B %d, %Y %I:%M %p")  # "March 15, 2024 12:23 PM"

# Parse a date string to timestamp
parsed = datetime.strptime("2024-03-15 08:00:00", "%Y-%m-%d %H:%M:%S")
ts = int(parsed.replace(tzinfo=timezone.utc).timestamp())

# Add 7 days
next_week = dt + timedelta(days=7)

# Convert between timezones
eastern = dt.astimezone(timezone(timedelta(hours=-5)))

# Get individual components
year, month, day = dt.year, dt.month, dt.day
// Type-safe timestamp utilities

// Current Unix timestamp (seconds)
const now: number = Math.floor(Date.now() / 1000);

// Convert timestamp to Date
function fromUnix(ts: number): Date {
  return new Date(ts * 1000);
}

// Format with Intl.DateTimeFormat (no library needed)
function formatDate(ts: number, tz: string = "UTC"): string {
  return new Intl.DateTimeFormat("en-US", {
    timeZone: tz,
    year: "numeric",
    month: "short",
    day: "2-digit",
    hour: "2-digit",
    minute: "2-digit",
    second: "2-digit",
    hour12: false,
  }).format(fromUnix(ts));
}

// Relative time (e.g. "3 hours ago")
function timeAgo(ts: number): string {
  const rtf = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
  const diff = ts - Math.floor(Date.now() / 1000);
  const absDiff = Math.abs(diff);

  if (absDiff < 60) return rtf.format(diff, "second");
  if (absDiff < 3600) return rtf.format(Math.round(diff / 60), "minute");
  if (absDiff < 86400) return rtf.format(Math.round(diff / 3600), "hour");
  return rtf.format(Math.round(diff / 86400), "day");
}

// ISO 8601 to Unix timestamp
const ts = Math.floor(new Date("2024-03-15T08:00:00Z").getTime() / 1000);
// Type-safe timestamp utilities

// Current Unix timestamp (seconds)
const now: number = Math.floor(Date.now() / 1000);

// Convert timestamp to Date
function fromUnix(ts: number): Date {
  return new Date(ts * 1000);
}

// Format with Intl.DateTimeFormat (no library needed)
function formatDate(ts: number, tz: string = "UTC"): string {
  return new Intl.DateTimeFormat("en-US", {
    timeZone: tz,
    year: "numeric",
    month: "short",
    day: "2-digit",
    hour: "2-digit",
    minute: "2-digit",
    second: "2-digit",
    hour12: false,
  }).format(fromUnix(ts));
}

// Relative time (e.g. "3 hours ago")
function timeAgo(ts: number): string {
  const rtf = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
  const diff = ts - Math.floor(Date.now() / 1000);
  const absDiff = Math.abs(diff);

  if (absDiff < 60) return rtf.format(diff, "second");
  if (absDiff < 3600) return rtf.format(Math.round(diff / 60), "minute");
  if (absDiff < 86400) return rtf.format(Math.round(diff / 3600), "hour");
  return rtf.format(Math.round(diff / 86400), "day");
}

// ISO 8601 to Unix timestamp
const ts = Math.floor(new Date("2024-03-15T08:00:00Z").getTime() / 1000);
import java.time.*;
import java.time.format.DateTimeFormatter;

public class TimestampExample {
    public static void main(String[] args) {
        // Current Unix timestamp (seconds)
        long now = Instant.now().getEpochSecond();

        // Current timestamp in milliseconds
        long ms = System.currentTimeMillis();

        // Convert timestamp to Instant
        Instant instant = Instant.ofEpochSecond(1710492223L);

        // Format to ISO 8601
        instant.toString(); // "2024-03-15T12:23:43Z"

        // Convert to ZonedDateTime for formatting
        ZonedDateTime zdt = instant.atZone(ZoneId.of("America/New_York"));
        DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss z");
        String formatted = zdt.format(fmt); // "2024-03-15 08:23:43 EDT"

        // Parse a date string to timestamp
        LocalDateTime ldt = LocalDateTime.parse("2024-03-15T08:00:00");
        long ts = ldt.toEpochSecond(ZoneOffset.UTC);

        // Add 7 days
        Instant nextWeek = instant.plus(Duration.ofDays(7));

        // Compare timestamps
        boolean isAfter = Instant.now().isAfter(instant);
    }
}
import java.time.*;
import java.time.format.DateTimeFormatter;

public class TimestampExample {
    public static void main(String[] args) {
        // Current Unix timestamp (seconds)
        long now = Instant.now().getEpochSecond();

        // Current timestamp in milliseconds
        long ms = System.currentTimeMillis();

        // Convert timestamp to Instant
        Instant instant = Instant.ofEpochSecond(1710492223L);

        // Format to ISO 8601
        instant.toString(); // "2024-03-15T12:23:43Z"

        // Convert to ZonedDateTime for formatting
        ZonedDateTime zdt = instant.atZone(ZoneId.of("America/New_York"));
        DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss z");
        String formatted = zdt.format(fmt); // "2024-03-15 08:23:43 EDT"

        // Parse a date string to timestamp
        LocalDateTime ldt = LocalDateTime.parse("2024-03-15T08:00:00");
        long ts = ldt.toEpochSecond(ZoneOffset.UTC);

        // Add 7 days
        Instant nextWeek = instant.plus(Duration.ofDays(7));

        // Compare timestamps
        boolean isAfter = Instant.now().isAfter(instant);
    }
}
package main

import (
	"fmt"
	"time"
)

func main() {
	// Current Unix timestamp (seconds)
	now := time.Now().Unix()

	// Current timestamp in milliseconds
	ms := time.Now().UnixMilli()

	// Convert timestamp to Time
	t := time.Unix(1710492223, 0).UTC()

	// Format to ISO 8601
	t.Format(time.RFC3339) // "2024-03-15T12:23:43Z"

	// Custom format (Go uses reference time: Mon Jan 2 15:04:05 2006)
	t.Format("2006-01-02 15:04:05") // "2024-03-15 12:23:43"
	t.Format("Jan 02, 2006 3:04 PM") // "Mar 15, 2024 12:23 PM"

	// Parse a date string to timestamp
	parsed, _ := time.Parse("2006-01-02 15:04:05", "2024-03-15 08:00:00")
	ts := parsed.Unix()

	// Add 7 days
	nextWeek := t.AddDate(0, 0, 7)

	// Convert to a specific timezone
	loc, _ := time.LoadLocation("America/New_York")
	eastern := t.In(loc)

	// Get individual components
	year, month, day := t.Date()
	hour, min, sec := t.Clock()

	fmt.Println(now, ms, ts, nextWeek, eastern, year, month, day, hour, min, sec)
}
package main

import (
	"fmt"
	"time"
)

func main() {
	// Current Unix timestamp (seconds)
	now := time.Now().Unix()

	// Current timestamp in milliseconds
	ms := time.Now().UnixMilli()

	// Convert timestamp to Time
	t := time.Unix(1710492223, 0).UTC()

	// Format to ISO 8601
	t.Format(time.RFC3339) // "2024-03-15T12:23:43Z"

	// Custom format (Go uses reference time: Mon Jan 2 15:04:05 2006)
	t.Format("2006-01-02 15:04:05") // "2024-03-15 12:23:43"
	t.Format("Jan 02, 2006 3:04 PM") // "Mar 15, 2024 12:23 PM"

	// Parse a date string to timestamp
	parsed, _ := time.Parse("2006-01-02 15:04:05", "2024-03-15 08:00:00")
	ts := parsed.Unix()

	// Add 7 days
	nextWeek := t.AddDate(0, 0, 7)

	// Convert to a specific timezone
	loc, _ := time.LoadLocation("America/New_York")
	eastern := t.In(loc)

	// Get individual components
	year, month, day := t.Date()
	hour, min, sec := t.Clock()

	fmt.Println(now, ms, ts, nextWeek, eastern, year, month, day, hour, min, sec)
}
use chrono::{DateTime, NaiveDateTime, TimeZone, Utc, Duration, FixedOffset};

fn main() {
    // Current Unix timestamp (seconds)
    let now = Utc::now().timestamp();

    // Current timestamp in milliseconds
    let ms = Utc::now().timestamp_millis();

    // Convert timestamp to DateTime
    let dt = DateTime::from_timestamp(1710492223, 0).unwrap();

    // Format to ISO 8601
    dt.to_rfc3339(); // "2024-03-15T12:23:43+00:00"

    // Custom format with strftime
    dt.format("%Y-%m-%d %H:%M:%S").to_string(); // "2024-03-15 12:23:43"
    dt.format("%B %d, %Y %I:%M %p").to_string(); // "March 15, 2024 12:23 PM"

    // Parse a date string to timestamp
    let parsed = NaiveDateTime::parse_from_str(
        "2024-03-15 08:00:00", "%Y-%m-%d %H:%M:%S"
    ).unwrap();
    let ts = parsed.and_utc().timestamp();

    // Add 7 days
    let next_week = dt + Duration::days(7);

    // Convert to a fixed offset timezone (UTC-5)
    let eastern = FixedOffset::west_opt(5 * 3600).unwrap();
    let est_time = dt.with_timezone(&eastern);

    println!("{now} {ms} {ts} {next_week} {est_time}");
}
use chrono::{DateTime, NaiveDateTime, TimeZone, Utc, Duration, FixedOffset};

fn main() {
    // Current Unix timestamp (seconds)
    let now = Utc::now().timestamp();

    // Current timestamp in milliseconds
    let ms = Utc::now().timestamp_millis();

    // Convert timestamp to DateTime
    let dt = DateTime::from_timestamp(1710492223, 0).unwrap();

    // Format to ISO 8601
    dt.to_rfc3339(); // "2024-03-15T12:23:43+00:00"

    // Custom format with strftime
    dt.format("%Y-%m-%d %H:%M:%S").to_string(); // "2024-03-15 12:23:43"
    dt.format("%B %d, %Y %I:%M %p").to_string(); // "March 15, 2024 12:23 PM"

    // Parse a date string to timestamp
    let parsed = NaiveDateTime::parse_from_str(
        "2024-03-15 08:00:00", "%Y-%m-%d %H:%M:%S"
    ).unwrap();
    let ts = parsed.and_utc().timestamp();

    // Add 7 days
    let next_week = dt + Duration::days(7);

    // Convert to a fixed offset timezone (UTC-5)
    let eastern = FixedOffset::west_opt(5 * 3600).unwrap();
    let est_time = dt.with_timezone(&eastern);

    println!("{now} {ms} {ts} {next_week} {est_time}");
}
<?php
// Current Unix timestamp (seconds)
$now = time();

// Current timestamp in milliseconds
$ms = (int)(microtime(true) * 1000);

// Convert timestamp to formatted date
$date = date('Y-m-d H:i:s', 1710492223); // "2024-03-15 12:23:43"

// Format to ISO 8601
$iso = date('c', 1710492223); // "2024-03-15T12:23:43+00:00"

// Custom format
date('F j, Y g:i A', 1710492223); // "March 15, 2024 12:23 PM"

// Parse a date string to timestamp
$ts = strtotime('2024-03-15 08:00:00');

// Using DateTime object (recommended)
$dt = new DateTime('@1710492223');
$dt->setTimezone(new DateTimeZone('America/New_York'));
echo $dt->format('Y-m-d H:i:s T'); // "2024-03-15 08:23:43 EDT"

// Add 7 days
$dt->modify('+7 days');

// Create from format
$parsed = DateTime::createFromFormat('Y-m-d H:i:s', '2024-03-15 08:00:00');
$ts = $parsed->getTimestamp();

// Compare dates
$isExpired = time() > $expiresAt;
<?php
// Current Unix timestamp (seconds)
$now = time();

// Current timestamp in milliseconds
$ms = (int)(microtime(true) * 1000);

// Convert timestamp to formatted date
$date = date('Y-m-d H:i:s', 1710492223); // "2024-03-15 12:23:43"

// Format to ISO 8601
$iso = date('c', 1710492223); // "2024-03-15T12:23:43+00:00"

// Custom format
date('F j, Y g:i A', 1710492223); // "March 15, 2024 12:23 PM"

// Parse a date string to timestamp
$ts = strtotime('2024-03-15 08:00:00');

// Using DateTime object (recommended)
$dt = new DateTime('@1710492223');
$dt->setTimezone(new DateTimeZone('America/New_York'));
echo $dt->format('Y-m-d H:i:s T'); // "2024-03-15 08:23:43 EDT"

// Add 7 days
$dt->modify('+7 days');

// Create from format
$parsed = DateTime::createFromFormat('Y-m-d H:i:s', '2024-03-15 08:00:00');
$ts = $parsed->getTimestamp();

// Compare dates
$isExpired = time() > $expiresAt;
require 'time'

# Current Unix timestamp (seconds)
now = Time.now.to_i

# Current timestamp in milliseconds
ms = (Time.now.to_f * 1000).to_i

# Convert timestamp to Time object
t = Time.at(1710492223).utc

# Format to ISO 8601
t.iso8601  # "2024-03-15T12:23:43Z"

# Custom format with strftime
t.strftime('%Y-%m-%d %H:%M:%S')      # "2024-03-15 12:23:43"
t.strftime('%B %d, %Y %I:%M %p')     # "March 15, 2024 12:23 PM"

# Parse a date string to timestamp
ts = Time.parse('2024-03-15 08:00:00 UTC').to_i

# Add 7 days (seconds)
next_week = t + (7 * 24 * 60 * 60)

# Convert to a specific timezone
ENV['TZ'] = 'America/New_York'
eastern = Time.at(1710492223)
ENV['TZ'] = nil

# Get individual components
year  = t.year
month = t.month
day   = t.day
hour  = t.hour
require 'time'

# Current Unix timestamp (seconds)
now = Time.now.to_i

# Current timestamp in milliseconds
ms = (Time.now.to_f * 1000).to_i

# Convert timestamp to Time object
t = Time.at(1710492223).utc

# Format to ISO 8601
t.iso8601  # "2024-03-15T12:23:43Z"

# Custom format with strftime
t.strftime('%Y-%m-%d %H:%M:%S')      # "2024-03-15 12:23:43"
t.strftime('%B %d, %Y %I:%M %p')     # "March 15, 2024 12:23 PM"

# Parse a date string to timestamp
ts = Time.parse('2024-03-15 08:00:00 UTC').to_i

# Add 7 days (seconds)
next_week = t + (7 * 24 * 60 * 60)

# Convert to a specific timezone
ENV['TZ'] = 'America/New_York'
eastern = Time.at(1710492223)
ENV['TZ'] = nil

# Get individual components
year  = t.year
month = t.month
day   = t.day
hour  = t.hour
using System;
using System.Globalization;

// Current Unix timestamp (seconds)
long now = DateTimeOffset.UtcNow.ToUnixTimeSeconds();

// Current timestamp in milliseconds
long ms = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();

// Convert timestamp to DateTimeOffset
var dto = DateTimeOffset.FromUnixTimeSeconds(1710492223);

// Format to ISO 8601
dto.ToString("o"); // "2024-03-15T12:23:43.0000000+00:00"

// Custom format
dto.ToString("yyyy-MM-dd HH:mm:ss");       // "2024-03-15 12:23:43"
dto.ToString("MMMM dd, yyyy h:mm tt");     // "March 15, 2024 12:23 PM"

// Parse a date string to timestamp
var parsed = DateTimeOffset.Parse("2024-03-15T08:00:00Z");
long ts = parsed.ToUnixTimeSeconds();

// Add 7 days
var nextWeek = dto.AddDays(7);

// Convert to a specific timezone
var eastern = TimeZoneInfo.FindSystemTimeZoneById("America/New_York");
var estTime = TimeZoneInfo.ConvertTime(dto, eastern);

// Compare timestamps
bool isExpired = DateTimeOffset.UtcNow > dto;
using System;
using System.Globalization;

// Current Unix timestamp (seconds)
long now = DateTimeOffset.UtcNow.ToUnixTimeSeconds();

// Current timestamp in milliseconds
long ms = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();

// Convert timestamp to DateTimeOffset
var dto = DateTimeOffset.FromUnixTimeSeconds(1710492223);

// Format to ISO 8601
dto.ToString("o"); // "2024-03-15T12:23:43.0000000+00:00"

// Custom format
dto.ToString("yyyy-MM-dd HH:mm:ss");       // "2024-03-15 12:23:43"
dto.ToString("MMMM dd, yyyy h:mm tt");     // "March 15, 2024 12:23 PM"

// Parse a date string to timestamp
var parsed = DateTimeOffset.Parse("2024-03-15T08:00:00Z");
long ts = parsed.ToUnixTimeSeconds();

// Add 7 days
var nextWeek = dto.AddDays(7);

// Convert to a specific timezone
var eastern = TimeZoneInfo.FindSystemTimeZoneById("America/New_York");
var estTime = TimeZoneInfo.ConvertTime(dto, eastern);

// Compare timestamps
bool isExpired = DateTimeOffset.UtcNow > dto;
import Foundation

// Current Unix timestamp (seconds)
let now = Int(Date().timeIntervalSince1970)

// Current timestamp in milliseconds
let ms = Int(Date().timeIntervalSince1970 * 1000)

// Convert timestamp to Date
let date = Date(timeIntervalSince1970: 1710492223)

// Format to ISO 8601
let isoFormatter = ISO8601DateFormatter()
isoFormatter.string(from: date) // "2024-03-15T12:23:43Z"

// Custom format with DateFormatter
let fmt = DateFormatter()
fmt.dateFormat = "yyyy-MM-dd HH:mm:ss"
fmt.timeZone = TimeZone(identifier: "UTC")
fmt.string(from: date) // "2024-03-15 12:23:43"

// Locale-aware formatting
fmt.dateStyle = .full
fmt.timeStyle = .long
fmt.timeZone = TimeZone(identifier: "America/New_York")
fmt.string(from: date) // "Friday, March 15, 2024 at 8:23:43 AM EDT"

// Parse a date string to timestamp
fmt.dateFormat = "yyyy-MM-dd HH:mm:ss"
if let parsed = fmt.date(from: "2024-03-15 08:00:00") {
    let ts = Int(parsed.timeIntervalSince1970)
}

// Add 7 days
let nextWeek = Calendar.current.date(byAdding: .day, value: 7, to: date)!
import Foundation

// Current Unix timestamp (seconds)
let now = Int(Date().timeIntervalSince1970)

// Current timestamp in milliseconds
let ms = Int(Date().timeIntervalSince1970 * 1000)

// Convert timestamp to Date
let date = Date(timeIntervalSince1970: 1710492223)

// Format to ISO 8601
let isoFormatter = ISO8601DateFormatter()
isoFormatter.string(from: date) // "2024-03-15T12:23:43Z"

// Custom format with DateFormatter
let fmt = DateFormatter()
fmt.dateFormat = "yyyy-MM-dd HH:mm:ss"
fmt.timeZone = TimeZone(identifier: "UTC")
fmt.string(from: date) // "2024-03-15 12:23:43"

// Locale-aware formatting
fmt.dateStyle = .full
fmt.timeStyle = .long
fmt.timeZone = TimeZone(identifier: "America/New_York")
fmt.string(from: date) // "Friday, March 15, 2024 at 8:23:43 AM EDT"

// Parse a date string to timestamp
fmt.dateFormat = "yyyy-MM-dd HH:mm:ss"
if let parsed = fmt.date(from: "2024-03-15 08:00:00") {
    let ts = Int(parsed.timeIntervalSince1970)
}

// Add 7 days
let nextWeek = Calendar.current.date(byAdding: .day, value: 7, to: date)!
import java.time.*
import java.time.format.DateTimeFormatter

fun main() {
    // Current Unix timestamp (seconds)
    val now = Instant.now().epochSecond

    // Current timestamp in milliseconds
    val ms = System.currentTimeMillis()

    // Convert timestamp to Instant
    val instant = Instant.ofEpochSecond(1710492223L)

    // Format to ISO 8601
    instant.toString() // "2024-03-15T12:23:43Z"

    // Convert to ZonedDateTime for custom formatting
    val zdt = instant.atZone(ZoneId.of("America/New_York"))
    val fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss z")
    zdt.format(fmt) // "2024-03-15 08:23:43 EDT"

    // Parse a date string to timestamp
    val parsed = LocalDateTime.parse("2024-03-15T08:00:00")
    val ts = parsed.toEpochSecond(ZoneOffset.UTC)

    // Add 7 days
    val nextWeek = instant.plus(Duration.ofDays(7))

    // Relative time calculation
    val duration = Duration.between(instant, Instant.now())
    println("${duration.toDays()} days ago")
}
import java.time.*
import java.time.format.DateTimeFormatter

fun main() {
    // Current Unix timestamp (seconds)
    val now = Instant.now().epochSecond

    // Current timestamp in milliseconds
    val ms = System.currentTimeMillis()

    // Convert timestamp to Instant
    val instant = Instant.ofEpochSecond(1710492223L)

    // Format to ISO 8601
    instant.toString() // "2024-03-15T12:23:43Z"

    // Convert to ZonedDateTime for custom formatting
    val zdt = instant.atZone(ZoneId.of("America/New_York"))
    val fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss z")
    zdt.format(fmt) // "2024-03-15 08:23:43 EDT"

    // Parse a date string to timestamp
    val parsed = LocalDateTime.parse("2024-03-15T08:00:00")
    val ts = parsed.toEpochSecond(ZoneOffset.UTC)

    // Add 7 days
    val nextWeek = instant.plus(Duration.ofDays(7))

    // Relative time calculation
    val duration = Duration.between(instant, Instant.now())
    println("${duration.toDays()} days ago")
}

Fonctionnalités

Timestamp Unix en temps réel

Affichage du timestamp Unix en direct avec précision à la milliseconde. Mettez en pause, copiez ou sautez instantanément à un moment précis.

Comparaison des fuseaux horaires

Comparez l’heure actuelle dans plus de 30 fuseaux horaires. Consultez les décalages UTC et les formats localisés en un coup d’œil.

Détection de timestamps dans les logs

Collez des logs serveur ou n’importe quel texte : les timestamps Unix, ISO 8601 et formats courants sont détectés et surlignés automatiquement.

Sauts rapides dans le temps

Accédez à aujourd’hui, demain, début de semaine, début de mois, début d’année ou epoch zéro en un clic.

Formats de timestamp pris en charge

FormatExemple
Secondes Unix1710492223
Millisecondes Unix1710492245832
ISO 86012024-03-15T08:23:41.192Z
ISO 8601 avec décalage2024-03-15T20:24:05+08:00
Date et heure2024-03-15 08:23:42
Format de log courant15/Mar/2024:08:24:05 +0000
Lisible par humainMar 15, 2024 08:24:01

Questions fréquentes

Un timestamp Unix, aussi appelé Epoch time ou POSIX time, correspond au nombre de secondes écoulées depuis le 1er janvier 1970 à 00:00:00 UTC. Il est largement utilisé en programmation, dans les bases de données et les logs serveur comme représentation universelle du temps.

Cet outil détecte automatiquement les timestamps Unix en secondes et millisecondes, les dates ISO 8601, les formats de logs courants (Apache/Nginx), les dates lisibles, etc. Collez simplement votre texte : les timestamps seront surlignés automatiquement.

Non. Toute la conversion et la détection de timestamps se fait dans votre navigateur. Vos données ne quittent jamais votre appareil : aucune requête serveur, aucune collecte.

Oui. Le panneau des fuseaux horaires affiche simultanément l’heure actuelle ou mise en pause dans plus de 30 fuseaux horaires, ce qui facilite la coordination entre régions.

Une collection grandissante d'utilitaires développeur rapides et respectueux de la vie privée. Tous les outils s'exécutent dans votre navigateur ; vos données ne quittent pas votre appareil.

Outils

Analyseur JSONValidateur JSON SchemaConvertisseur JSONJSON vers TypeScriptVisionneuse OpenAPIFormateur de codeFormateur SQLConvertisseur cURLConvertisseur timestampParseur CronEncodeur URLOutil QR codeCalculateur IP et CIDROutil Gzip et DeflateDécodeur JWTOutil JWT Verify et JWKGénérateur de hashMot de passe et TOTPEncodeur Base64Générateur UUIDMétadonnées imageCompression imageTiny compresseur imageBoîte à outils image ProEnregistreur d’écranTesteur RegexDiff texteAperçu Markdown et MermaidOutil couleur et contraste

Légal

Politique de confidentialitéConditions d'utilisation

© 2026 ZPTools. Tous droits réservés.