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 | 1781846758 |
| 1 hour ago | 1781843158 |
| 2 hours ago | 1781839558 |
| 3 hours ago | 1781835958 |
| 6 hours ago | 1781825158 |
| 12 hours ago | 1781803558 |
| 1 day ago | 1781760358 |
| 2 days ago | 1781673958 |
| 3 days ago | 1781587558 |
| 1 week ago | 1781241958 |
| 2 weeks ago | 1780637158 |
| 3 weeks ago | 1780032358 |
| 4 weeks ago | 1779427558 |
| 1 month ago | 1779168358 |
| 2 months ago | 1776576358 |
| 3 months ago | 1773897958 |
| 6 months ago | 1766125558 |
| 9 months ago | 1758259558 |
| 1 year ago | 1750310758 |
| 2 years ago | 1718774758 |
| 3 years ago | 1687152358 |
| 5 years ago | 1624080358 |
| 10 years ago | 1466313958 |
Upcoming dates
| Date | Unix timestamp |
|---|---|
| Now | 1781846758 |
| In 1 hour | 1781850358 |
| In 2 hours | 1781853958 |
| In 3 hours | 1781857558 |
| In 6 hours | 1781868358 |
| In 12 hours | 1781889958 |
| In 1 day | 1781933158 |
| In 2 days | 1782019558 |
| In 3 days | 1782105958 |
| In 1 week | 1782451558 |
| In 2 weeks | 1783056358 |
| In 3 weeks | 1783661158 |
| In 4 weeks | 1784265958 |
| In 1 month | 1784438758 |
| In 2 months | 1787117158 |
| In 3 months | 1789795558 |
| In 6 months | 1797661558 |
| In 9 months | 1805433958 |
| In 1 year | 1813382758 |
| In 2 years | 1845005158 |
| In 3 years | 1876541158 |
| In 5 years | 1939613158 |
| In 10 years | 2097465958 |
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-06-19 01:25:58'))
Option 2
INSERT INTO mytable
VALUES(1,'hello',UNIX_TIMESTAMP(now()))
Option 3
VALUES(1,'hello',UNIX_TIMESTAMP('1781846758'))
SELECT FROM_UNIXTIME(1781846758);
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 1781846758
Love ToolsYEP? Support our Work!