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 | 1786550127 |
| 1 hour ago | 1786546527 |
| 2 hours ago | 1786542927 |
| 3 hours ago | 1786539327 |
| 6 hours ago | 1786528527 |
| 12 hours ago | 1786506927 |
| 1 day ago | 1786463727 |
| 2 days ago | 1786377327 |
| 3 days ago | 1786290927 |
| 1 week ago | 1785945327 |
| 2 weeks ago | 1785340527 |
| 3 weeks ago | 1784735727 |
| 4 weeks ago | 1784130927 |
| 1 month ago | 1783871727 |
| 2 months ago | 1781279727 |
| 3 months ago | 1778601327 |
| 6 months ago | 1770915327 |
| 9 months ago | 1762966527 |
| 1 year ago | 1755014127 |
| 2 years ago | 1723478127 |
| 3 years ago | 1691855727 |
| 5 years ago | 1628783727 |
| 10 years ago | 1471017327 |
Upcoming dates
| Date | Unix timestamp |
|---|---|
| Now | 1786550127 |
| In 1 hour | 1786553727 |
| In 2 hours | 1786557327 |
| In 3 hours | 1786560927 |
| In 6 hours | 1786571727 |
| In 12 hours | 1786593327 |
| In 1 day | 1786636527 |
| In 2 days | 1786722927 |
| In 3 days | 1786809327 |
| In 1 week | 1787154927 |
| In 2 weeks | 1787759727 |
| In 3 weeks | 1788364527 |
| In 4 weeks | 1788969327 |
| In 1 month | 1789228527 |
| In 2 months | 1791820527 |
| In 3 months | 1794502527 |
| In 6 months | 1802451327 |
| In 9 months | 1810137327 |
| In 1 year | 1818086127 |
| In 2 years | 1849708527 |
| In 3 years | 1881244527 |
| In 5 years | 1944316527 |
| In 10 years | 2102169327 |
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-08-12 11:55:27'))
Option 2
INSERT INTO mytable
VALUES(1,'hello',UNIX_TIMESTAMP(now()))
Option 3
VALUES(1,'hello',UNIX_TIMESTAMP('1786550127'))
SELECT FROM_UNIXTIME(1786550127);
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 1786550127
Love ToolsYEP? Support our Work!