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
Now1791078231
1 hour ago1791074631
2 hours ago1791071031
3 hours ago1791067431
6 hours ago1791056631
12 hours ago1791035031
1 day ago1790991831
2 days ago1790905431
3 days ago1790819031
1 week ago1790473431
2 weeks ago1789868631
3 weeks ago1789263831
4 weeks ago1788659031
1 month ago1788486231
2 months ago1785807831
3 months ago1783129431
6 months ago1775267031
9 months ago1767494631
1 year ago1759542231
2 years ago1728006231
3 years ago1696383831
5 years ago1633311831
10 years ago1475545431

Upcoming dates

Date Unix timestamp
Now1791078231
In 1 hour1791081831
In 2 hours1791085431
In 3 hours1791089031
In 6 hours1791099831
In 12 hours1791121431
In 1 day1791164631
In 2 days1791251031
In 3 days1791337431
In 1 week1791683031
In 2 weeks1792287831
In 3 weeks1792892631
In 4 weeks1793497431
In 1 month1793760231
In 2 months1796352231
In 3 months1799030631
In 6 months1806803031
In 9 months1814665431
In 1 year1822614231
In 2 years1854236631
In 3 years1885772631
In 5 years1948844631
In 10 years2106697431

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-04 01:43:51.122

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 1791078231


#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 03 Oct 21:43:51 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()
1791078231

Option 2

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

Option 3

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

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-03 21:43:51'))

Option 2

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

Option 3

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

SELECT FROM_UNIXTIME(1791078231);

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 3, 2026 21:43:51

Option 2

Get-Date DisplayHint Date
Saturday, October 3, 2026

Option 3

Get-Date -Format "dddd MM/dd/yyyy HH:mm K"
Saturday 10/03/2026 18:43 -07:00

Option 4

Get-Date -UnixTimeSeconds 1791078231
Saturday, October 03, 2026 09:43:51 PM

Share


Love ToolsYEP? Support our Work!

Buy us a coffee
TOP