Current Timestamp

This page show the current Unix timestamp

Share

Share

How useful was this tool for you?

★★★★★
Average rating: 4.5/5 based on 13 votes

Unix time stamp in: C++, C#, JAVA, Python, PHP, Javascript, MySQL, Oracle, PostgresSQL, Snowflake, PowerShell, Unix time on Wikipedia.org

Recent dates

Date Unix timestamp
Now1792842570
1 hour ago1792838970
2 hours ago1792835370
3 hours ago1792831770
6 hours ago1792820970
12 hours ago1792799370
1 day ago1792756170
2 days ago1792669770
3 days ago1792583370
1 week ago1792237770
2 weeks ago1791632970
3 weeks ago1791028170
4 weeks ago1790423370
1 month ago1790250570
2 months ago1787572170
3 months ago1784893770
6 months ago1777031370
9 months ago1769258970
1 year ago1761306570
2 years ago1729770570
3 years ago1698148170
5 years ago1635076170
10 years ago1477309770

Upcoming dates

Date Unix timestamp
Now1792842570
In 1 hour1792846170
In 2 hours1792849770
In 3 hours1792853370
In 6 hours1792864170
In 12 hours1792885770
In 1 day1792928970
In 2 days1793015370
In 3 days1793101770
In 1 week1793447370
In 2 weeks1794055770
In 3 weeks1794660570
In 4 weeks1795265370
In 1 month1795524570
In 2 months1798116570
In 3 months1800794970
In 6 months1808567370
In 9 months1816429770
In 1 year1824378570
In 2 years1856000970
In 3 years1887536970
In 5 years1950608970
In 10 years2108461770

How to get current timestamp in Java

Here is an example how you can get current timestamp in Java

Java

import java.sql.Timestamp;
import java.util.Date;

public class CurrentTimeStamp {
    public static void main(String[] args) {
        Date date = new Date();
        System.out.println(new Timestamp(date.getTime()));
    }
}

Output

2026-10-24 11:49:30.859

How to get current timestamp in C++

Here is an example how you can get current timestamp in C++

C++


#include <stdio.h>
#include <time.h>

int main()
{
    time_t now;
    now = time(NULL);
    printf("Current unix time is %d", now);

    return 0;
}

Execution

Current unix time is 1792842570


#include <stdio.h>
#include <time.h>

int main ()
{
  time_t rawtime;
  struct tm * timeinfo;

  time (&rawtime);
  timeinfo = localtime (&rawtime);
  printf ("Current local time and date: %s", asctime(timeinfo));

  return 0;
}

Execution

Current local time and date: Sat 24 Oct 07:49:30 2026

How to get current timestamp in c#

Here is an example how you can get current timestamp in c#

Option 1

DateTimeOffset.UtcNow.ToUnixTimeSeconds()
1792842570

Option 2

DateTimeOffset now = DateTimeOffset.Now;
long timestamp = now.ToUnixTimeMilliseconds();
1792842570859

Option 3

DateTime currentDateUtc = DateTime.UtcNow.Date;
string formattedDate = currentDate.ToString("yyyy-MM-dd")
2026-10-24

How to get current timestamp in Python

Here is an example how you can get current timestamp in Python

import time
import datetime

print "Current unix time: %s" %time.time()
print "Current date and time: " , datetime.datetime.now()

Output

Current unix time: 1409073472.17 Current date and time: 2014-08-26 12:17:52.165704

How to get current timestamp in PHP

Here is an example how you can get current timestamp in PHP

echo time();

How to get current timestamp in Javascript

Here is an example how you can get current timestamp in Javascript

var timestamp = new Date().getTime();

document.write(timestamp);

Output

How to get current timestamp in MySQL

Here is an example how you can get current timestamp in MySQL

CREATE TABLE `mytable` (
`id` int(11) NOT NULL,
`text` varchar(100) NOT NULL,
`epoch` int(11) NOT NULL
);

Option 1

CREATE TABLE `mytable` (
`id` int(11) NOT NULL,
`text` varchar(100) NOT NULL,
`epoch` int(11) NOT NULL
);
INSERT INTO mytable
VALUES(1,'hello',UNIX_TIMESTAMP('2026-10-24 07:49:30'))

Option 2

INSERT INTO mytable
VALUES(1,'hello',UNIX_TIMESTAMP(now()))

Option 3

VALUES(1,'hello',UNIX_TIMESTAMP('1792842570'))

SELECT FROM_UNIXTIME(1792842570);

How to get current timestamp in Oracle

Here is an example how you can get current timestamp in Oracle

Option 1

SELECT SYSTIMESTAMP FROM  DUAL;

Option 2

SELECT CURRENT_TIMESTAMP FROM  DUAL;

How to get current timestamp in PostgreSQL

Here is an example how you can get current timestamp in PostgreSQL

Option 1

SELECT NOW();

Option 2

SELECT CURRENT_TIMESTAMP;

How to get current timestamp in snowflake

Here is an example how you can get current timestamp in snowflake

Option 1

SELECT CURRENT_TIMESTAMP();

Option 2

SELECT CURRENT_TIME();

How to get current timestamp in PowerShell

Here is an example how you can get current timestamp in PowerShell

Option 1

Get-Date
Saturday, October 24, 2026 07:49:30

Option 2

Get-Date DisplayHint Date
Saturday, October 24, 2026

Option 3

Get-Date -Format "dddd MM/dd/yyyy HH:mm K"
Saturday 10/24/2026 04:49 -07:00

Option 4

Get-Date -UnixTimeSeconds 1792842570
Saturday, October 24, 2026 07:49:30 AM

Share


Love ToolsYEP? Support our Work!

Buy us a coffee
TOP