Timestamp tool

Easily realize the two-way conversion of local time and timestamps, supports multiple time zones and formats, providing developers with efficient and convenient time processing solutions

Real-time time

share

UNIX timestamp

0
millisecond: 0

Local time

Time zone: UTC

Timestampdate

Enter a time stamp

Select the target time zone

()

Standard:
ISO:
Local:
UTC:
Relative:

dateTimestamp

Select a date and time

Select the target time zone

()

UNIX timestamp:
Millisecond timestamp:
ISO:
UTC:
Local:
Relative:

About timestamp

What is a UNIX timestamp?

UNIX timestamps are the number of seconds elapsed from January 1, 1970 (UTC/GMT midnight), regardless of leap seconds. It is a way of representing time in computer systems.

Key Features

  • Independent of time zone, global unification
  • The maximum value of the 32-bit system is 2038-01-19 (2038 issue)
  • The 64-bit system can represent about 290 billion years
  • The millisecond timestamp adds three zeros at the end
  • Can be easily converted to human-readable date and time format

Common uses

  • Database record creation/update time
  • Log file time stamp
  • API Requests and Responses
  • Cache expiration control
  • Version control timestamp

Share the results

copy
shareshareshareshare

Programming language examples

JavaScript

// Get the current timestamp (milliseconds)
const timestampMs = Date.now();
// Get the current timestamp (seconds)
const timestampSec = Math.floor(Date.now() / 1000);

Python

import time

PHP

// Get the current timestamp (seconds)
$timestamp_sec = time();
// Get the current timestamp (ms)
$timestamp_ms = round(microtime(true) * 1000);

Java

// Get the current timestamp (ms)
long timestampMs = System.currentTimeMillis();
// Get the current timestamp (seconds)
long timestampSec = System.currentTimeMillis() / 1000;

JavaScript

NSDate().timeIntervalSince1970

Go

import (
time
)
int64(time.Now().Unix())

Objective-C

[[NSDate date] timeIntervalSince1970]

MySQL

SELECT unix_timestamp(now())

SQLite

SELECT strftime('%s', 'now')

Erlang

calendar:datetime_to_gregorian_seconds(calendar:universal_time())-719528*24*3600.

Lua

os.time()

Ruby

Time.now.to_i

Shell

date %s

Groovy

(new Date().time / 1000).longValue()

Dart

(new DateTime.now().millisecondsSinceEpoch/1000).truncate()

More time calculation tools

We also provide advanced functions such as time unit conversion, world time conversion time zone, world time tracker, etc. to meet your various time calculation needs