Current Timestamp

This page show the current Unix timestamp

Unix time stamp in: C++, JAVA, Python, PHP, Javascript, MySQL, Unix time on Wikipedia.org


Recent dates

Date Unix timestamp
Now1603876968
1 hour ago1603873368
2 hours ago1603869768
3 hours ago1603866168
6 hours ago1603855368
12 hours ago1603833768
1 day ago1603790568
2 days ago1603704168
3 days ago1603617768
1 week ago1603272168
2 weeks ago1602667368
3 weeks ago1602062568
4 weeks ago1601457768
1 month ago1601284968
2 months ago1598606568
3 months ago1595928168
6 months ago1588065768
9 months ago1580203368
1 year ago1572254568
2 years ago1540718568
3 years ago1509182568
5 years ago1446024168
10 years ago1288257768

Upcoming dates

Date Unix timestamp
Now1603876968
In 1 hour1603880568
In 2 hours1603884168
In 3 hours1603887768
In 6 hours1603898568
In 12 hours1603920168
In 1 day1603963368
In 2 days1604049768
In 3 days1604136168
In 1 week1604481768
In 2 weeks1605086568
In 3 weeks1605691368
In 4 weeks1606296168
In 1 month1606555368
In 2 months1609147368
In 3 months1611825768
In 6 months1619601768
In 9 months1627464168
In 1 year1635412968
In 2 years1666948968
In 3 years1698484968
In 5 years1761643368
In 10 years1919409768

How to get current timestamp in Java

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

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

output

2020-10-28 09:22:48.920
top

How to get current timestamp in C++

Here is an example how you can get current Unix timestamp in 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 1603876968

#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: Wed 28 Oct 09:22:48 2020
top

How to get current timestamp in Python

Here is an example how you can get current Unix 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
top

How to get current timestamp in PHP

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

<?php echo time(); ?>

output

1603876968
top

How to get current timestamp in Javascript

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

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

output

top

How to get current timestamp in MySQL

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

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

Option 1

INSERT INTO mytable VALUES(1,'hello',UNIX_TIMESTAMP('2020-10-28 09:22:48'))

Option 2

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

Option 3

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

SELECT FROM_UNIXTIME(1603876968);

Output

2020-10-28 09:22:48
top
TOP