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 |
|---|---|
| Now | 1784185663 |
| 1 hour ago | 1784182063 |
| 2 hours ago | 1784178463 |
| 3 hours ago | 1784174863 |
| 6 hours ago | 1784164063 |
| 12 hours ago | 1784142463 |
| 1 day ago | 1784099263 |
| 2 days ago | 1784012863 |
| 3 days ago | 1783926463 |
| 1 week ago | 1783580863 |
| 2 weeks ago | 1782976063 |
| 3 weeks ago | 1782371263 |
| 4 weeks ago | 1781766463 |
| 1 month ago | 1781593663 |
| 2 months ago | 1778915263 |
| 3 months ago | 1776323263 |
| 6 months ago | 1768550863 |
| 9 months ago | 1760598463 |
| 1 year ago | 1752649663 |
| 2 years ago | 1721113663 |
| 3 years ago | 1689491263 |
| 5 years ago | 1626419263 |
| 10 years ago | 1468652863 |
Upcoming dates
| Date | Unix timestamp |
|---|---|
| Now | 1784185663 |
| In 1 hour | 1784189263 |
| In 2 hours | 1784192863 |
| In 3 hours | 1784196463 |
| In 6 hours | 1784207263 |
| In 12 hours | 1784228863 |
| In 1 day | 1784272063 |
| In 2 days | 1784358463 |
| In 3 days | 1784444863 |
| In 1 week | 1784790463 |
| In 2 weeks | 1785395263 |
| In 3 weeks | 1786000063 |
| In 4 weeks | 1786604863 |
| In 1 month | 1786864063 |
| In 2 months | 1789542463 |
| In 3 months | 1792134463 |
| In 6 months | 1800086863 |
| In 9 months | 1807859263 |
| In 1 year | 1815721663 |
| In 2 years | 1847344063 |
| In 3 years | 1878880063 |
| In 5 years | 1941952063 |
| In 10 years | 2099804863 |
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
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
#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 c#
Here is an example how you can get current timestamp in c#
Option 1
DateTimeOffset.UtcNow.ToUnixTimeSeconds()
Option 2
DateTimeOffset now = DateTimeOffset.Now;
long timestamp = now.ToUnixTimeMilliseconds();
Option 3
DateTime currentDateUtc = DateTime.UtcNow.Date;
string formattedDate = currentDate.ToString("yyyy-MM-dd")
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
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-07-16 03:07:43'))
Option 2
INSERT INTO mytable
VALUES(1,'hello',UNIX_TIMESTAMP(now()))
Option 3
VALUES(1,'hello',UNIX_TIMESTAMP('1784185663'))
SELECT FROM_UNIXTIME(1784185663);
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
Option 2
Get-Date DisplayHint Date
Option 3
Get-Date -Format "dddd MM/dd/yyyy HH:mm K"
Option 4
Get-Date -UnixTimeSeconds 1784185663
Love ToolsYEP? Support our Work!