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 | 1777557474 |
| 1 hour ago | 1777553874 |
| 2 hours ago | 1777550274 |
| 3 hours ago | 1777546674 |
| 6 hours ago | 1777535874 |
| 12 hours ago | 1777514274 |
| 1 day ago | 1777471074 |
| 2 days ago | 1777384674 |
| 3 days ago | 1777298274 |
| 1 week ago | 1776952674 |
| 2 weeks ago | 1776347874 |
| 3 weeks ago | 1775743074 |
| 4 weeks ago | 1775138274 |
| 1 month ago | 1774879074 |
| 2 months ago | 1772463474 |
| 3 months ago | 1769785074 |
| 6 months ago | 1761832674 |
| 9 months ago | 1753883874 |
| 1 year ago | 1746021474 |
| 2 years ago | 1714485474 |
| 3 years ago | 1682863074 |
| 5 years ago | 1619791074 |
| 10 years ago | 1462024674 |
Upcoming dates
| Date | Unix timestamp |
|---|---|
| Now | 1777557474 |
| In 1 hour | 1777561074 |
| In 2 hours | 1777564674 |
| In 3 hours | 1777568274 |
| In 6 hours | 1777579074 |
| In 12 hours | 1777600674 |
| In 1 day | 1777643874 |
| In 2 days | 1777730274 |
| In 3 days | 1777816674 |
| In 1 week | 1778162274 |
| In 2 weeks | 1778767074 |
| In 3 weeks | 1779371874 |
| In 4 weeks | 1779976674 |
| In 1 month | 1780149474 |
| In 2 months | 1782827874 |
| In 3 months | 1785419874 |
| In 6 months | 1793368674 |
| In 9 months | 1801321074 |
| In 1 year | 1809093474 |
| In 2 years | 1840715874 |
| In 3 years | 1872251874 |
| In 5 years | 1935323874 |
| In 10 years | 2093176674 |
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 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
<?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
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 NOW();
How to get current timestamp in PowerShell
Here is an example how you can get current timestamp in PowerShell
Option 1
Get-DateOption 2
Get-Date DisplayHint DateOption 3
Get-Date -Format "dddd MM/dd/yyyy HH:mm K"Option 4
Get-Date -UnixTimeSeconds 1777557474Love ToolsYEP? Support our Work!