Unix タイムスタンプ変換・検出ツール — タイムスタンプをリアルタイムで変換、比較、検出

Unix タイムスタンプ
—

リアルタイム timestamp を読み込み中...

コピー一時停止更新貼り付け
クイック変換

Unix タイムスタンプまたは日付文字列を貼り付けると、Unix 秒、ミリ秒、ISO 8601、UTC、ローカライズ時刻、相対時刻へ即座に変換できます。

世界のタイムゾーン

40 以上の世界中のタイムゾーンの現在時刻をローカライズ形式で比較できます。

タイムスタンプのコード例

主要なプログラミング言語で Unix タイムスタンプを取得、整形、解析、変換する例です。

// 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")
}

主な機能

リアルタイム Unix タイムスタンプ

ミリ秒精度で更新される Unix タイムスタンプ表示です。一時停止、コピー、任意の時刻へのジャンプがすぐにできます。

世界のタイムゾーン比較

世界 30 以上のタイムゾーンの現在時刻を比較し、UTC オフセットとローカライズ表示をすばやく確認できます。

ログのタイムスタンプ検出

サーバーログや任意のテキストを貼り付けると、Unix、ISO 8601、一般的なログ形式など複数形式のタイムスタンプを自動検出してハイライトします。

クイック時刻ジャンプ

今日、明日、週初、月初、年初、epoch 0 へワンクリックでジャンプできます。

対応タイムスタンプ形式

形式例
Unix 秒1710492223
Unix ミリ秒1710492245832
ISO 86012024-03-15T08:23:41.192Z
オフセット付き ISO 86012024-03-15T20:24:05+08:00
日時2024-03-15 08:23:42
一般的なログ形式15/Mar/2024:08:24:05 +0000
人が読める形式Mar 15, 2024 08:24:01

よくある質問

Unix タイムスタンプ(Epoch time または POSIX time とも呼ばれます)は、1970 年 1 月 1 日 00:00:00 UTC から経過した秒数です。プログラミング、データベース、サーバーログで汎用的な時刻表現として広く使われます。

Unix タイムスタンプ(秒・ミリ秒)、ISO 8601、一般的なログ形式(Apache/Nginx)、人が読める日付文字列などを自動検出できます。テキストを貼り付けるだけでタイムスタンプが自動的にハイライトされます。

いいえ。すべてのタイムスタンプ変換と検出はブラウザー内で完結します。データは端末から離れず、サーバーリクエストもデータ収集もありません。

はい。タイムゾーンパネルでは 30 以上の世界中のタイムゾーンの現在(または一時停止中)の時刻を同時に表示でき、地域をまたいだ調整がしやすくなります。

高速でプライバシー重視の開発者ユーティリティ集です。すべてのツールはブラウザー内で動作し、データはデバイス外に送信されません。

ツール

JSON パーサーJSON Schema バリデーターJSON コンバーターJSON から TypeScriptJSON MinifierOpenAPI ビューアーコードフォーマッターSQL フォーマッターcURL コンバータータイムスタンプ変換Cron パーサーURL エンコーダーQR コードツールURL ParserIP・CIDR 計算Gzip・Deflate ツールJWT デコーダーJWT 検証・JWK ツールハッシュ生成パスワードと TOTPBase64 エンコーダーUUID 生成画像メタデータ画像圧縮Tiny 画像圧縮画像ツールキット Pro画面録画正規表現テスターCase ConverterLorem Ipsum Generatorテキスト DiffMarkdown・Mermaid プレビューカラー・コントラストツール

法務

プライバシーポリシー利用規約

© 2026 ZPTools. All Rights Reserved.