Marca de tiempo
La marca de tiempo actual también se conoce como marca de tiempo de Unix, hora de Unix y época de Unix. Indica la cantidad de segundos que han transcurrido desde el 1 de enero de 1970 (medianoche UTC / GMT). No cuenta los segundos intercalares.
Unix time stamp in: C++, JAVA, Python, PHP, Javascript, MySQL, Unix time on Wikipedia.org
Fechas recientes
Fecha | Marca de tiempo Unix |
---|---|
Now | 1611660153 |
1 hour ago | 1611656553 |
2 hours ago | 1611652953 |
3 hours ago | 1611649353 |
6 hours ago | 1611638553 |
12 hours ago | 1611616953 |
1 day ago | 1611573753 |
2 days ago | 1611487353 |
3 days ago | 1611400953 |
1 week ago | 1611055353 |
2 weeks ago | 1610450553 |
3 weeks ago | 1609845753 |
4 weeks ago | 1609240953 |
1 month ago | 1608981753 |
2 months ago | 1606389753 |
3 months ago | 1603711353 |
6 months ago | 1595762553 |
9 months ago | 1587900153 |
1 year ago | 1580037753 |
2 years ago | 1548501753 |
3 years ago | 1516965753 |
5 years ago | 1453807353 |
10 years ago | 1296040953 |
Fechas próximas
Fecha | Marca de tiempo Unix |
---|---|
Now | 1611660153 |
In 1 hour | 1611663753 |
In 2 hours | 1611667353 |
In 3 hours | 1611670953 |
In 6 hours | 1611681753 |
In 12 hours | 1611703353 |
In 1 day | 1611746553 |
In 2 days | 1611832953 |
In 3 days | 1611919353 |
In 1 week | 1612264953 |
In 2 weeks | 1612869753 |
In 3 weeks | 1613474553 |
In 4 weeks | 1614079353 |
In 1 month | 1614338553 |
In 2 months | 1616757753 |
In 3 months | 1619436153 |
In 6 months | 1627298553 |
In 9 months | 1635247353 |
In 1 year | 1643196153 |
In 2 years | 1674732153 |
In 3 years | 1706268153 |
In 5 years | 1769426553 |
In 10 years | 1927192953 |
Cómo obtener la marca de tiempo actual en Java
Este es un ejemplo de cómo obtener la marca de tiempo actual en 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()));
}
}
Resultado
Cómo obtener la marca de tiempo actual en C++
Este es un ejemplo de cómo obtener la marca de tiempo actual en 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
Cómo obtener la marca de tiempo actual en Python
Este es un ejemplo de cómo obtener la marca de tiempo actual en Python
import time
import datetime
print "Current unix time: %s" %time.time()
print "Current date and time: " , datetime.datetime.now()
Resultado
Cómo obtener la marca de tiempo actual en PHP
Este es un ejemplo de cómo obtener la marca de tiempo actual en PHP
<?php
echo time();
?>
Resultado
Cómo obtener la marca de tiempo actual en Javascript
Este es un ejemplo de cómo obtener la marca de tiempo actual en Javascript
var timestamp = new Date().getTime();
document.write(timestamp);
Resultado
Cómo obtener la marca de tiempo actual en MySQL
Este es un ejemplo de cómo obtener la marca de tiempo actual en 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