Current Timestamp
Current timestamp is also known as Unix timestamp, Unix time, and Unix epoch. It tells the number of seconds that have been elapsed since January 1, 1970 (midnight UTC/GMT). It doesn’t count leap seconds.
Unix time stamp in: C++, JAVA, Python, PHP, Javascript, MySQL, Unix time on Wikipedia.org
Recent dates
Date | Unix timestamp |
---|---|
Now | 1656973189 |
1 hour ago | 1656969589 |
2 hours ago | 1656965989 |
3 hours ago | 1656962389 |
6 hours ago | 1656951589 |
12 hours ago | 1656929989 |
1 day ago | 1656886789 |
2 days ago | 1656800389 |
3 days ago | 1656713989 |
1 week ago | 1656368389 |
2 weeks ago | 1655763589 |
3 weeks ago | 1655158789 |
4 weeks ago | 1654553989 |
1 month ago | 1654381189 |
2 months ago | 1651702789 |
3 months ago | 1649110789 |
6 months ago | 1641334789 |
9 months ago | 1633385989 |
1 year ago | 1625437189 |
2 years ago | 1593901189 |
3 years ago | 1562278789 |
5 years ago | 1499206789 |
10 years ago | 1341440389 |
Upcoming dates
Date | Unix timestamp |
---|---|
Now | 1656973189 |
In 1 hour | 1656976789 |
In 2 hours | 1656980389 |
In 3 hours | 1656983989 |
In 6 hours | 1656994789 |
In 12 hours | 1657016389 |
In 1 day | 1657059589 |
In 2 days | 1657145989 |
In 3 days | 1657232389 |
In 1 week | 1657577989 |
In 2 weeks | 1658182789 |
In 3 weeks | 1658787589 |
In 4 weeks | 1659392389 |
In 1 month | 1659651589 |
In 2 months | 1662329989 |
In 3 months | 1664921989 |
In 6 months | 1672870789 |
In 9 months | 1680646789 |
In 1 year | 1688509189 |
In 2 years | 1720131589 |
In 3 years | 1751667589 |
In 5 years | 1814739589 |
In 10 years | 1972592389 |
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
How to get current timestamp in C++
Here is an example how you can get current 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
#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
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
How to get current timestamp in PHP
Here is an example how you can get current timestamp in PHP
<?php
echo time();
?>
Output
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
Option 2
Option 3
Output