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
Now1789836254
1 hour ago1789832654
2 hours ago1789829054
3 hours ago1789825454
6 hours ago1789814654
12 hours ago1789793054
1 day ago1789749854
2 days ago1789663454
3 days ago1789577054
1 week ago1789231454
2 weeks ago1788626654
3 weeks ago1788021854
4 weeks ago1787417054
1 month ago1787157854
2 months ago1784479454
3 months ago1781887454
6 months ago1773938654
9 months ago1766166254
1 year ago1758300254
2 years ago1726764254
3 years ago1695141854
5 years ago1632069854
10 years ago1474303454

Upcoming dates

Date Unix timestamp
Now1789836254
In 1 hour1789839854
In 2 hours1789843454
In 3 hours1789847054
In 6 hours1789857854
In 12 hours1789879454
In 1 day1789922654
In 2 days1790009054
In 3 days1790095454
In 1 week1790441054
In 2 weeks1791045854
In 3 weeks1791650654
In 4 weeks1792255454
In 1 month1792428254
In 2 months1795110254
In 3 months1797702254
In 6 months1805474654
In 9 months1813423454
In 1 year1821372254
In 2 years1852994654
In 3 years1884530654
In 5 years1947602654
In 10 years2105455454

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-09-19 16:44:14.324

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 1789836254


#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 19 Sep 12:44:14 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()
1789836254

Option 2

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

Option 3

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

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-09-19 12:44:14'))

Option 2

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

Option 3

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

SELECT FROM_UNIXTIME(1789836254);

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, September 19, 2026 12:44:14

Option 2

Get-Date DisplayHint Date
Saturday, September 19, 2026

Option 3

Get-Date -Format "dddd MM/dd/yyyy HH:mm K"
Saturday 09/19/2026 09:44 -07:00

Option 4

Get-Date -UnixTimeSeconds 1789836254
Saturday, September 19, 2026 12:44:14 PM

Share


Love ToolsYEP? Support our Work!

Buy us a coffee
TOP