Timestamp To Date Converter
Convert timestamp to date or date to timestamp easily
Timestamp To Date
All languages has capability of converting timestamp to date. This page shows how to do it in several languages.
Python
Article with more details. Python expects timestamp as number of seconds since beginning of the Epoch.
Using datetime.isoformat
Module datetime provides classes for manipulating date and time in more object oriented way.
from datetime import datetime as dt
readable = dt.fromtimestamp(1733355010).isoformat()
print(readable)
# 2024-12-05T00:30:10+01:00
Using time.strftime
For custom human readable format you may use function strftime
.
import time
ts = time.gmtime()
print(time.strftime("%Y-%m-%d %H:%M:%S", ts))
# 2024-12-05 00:30:10
Using time.ctime
Another possibility to use function ctime
from module time
.
import time
readable = time.ctime(1733355010)
# Thu Dec 5 00:30:10 2024
JavaScript
Article with more details. JavaScript expects timestamp as number of miliseconds since beginning of the Epoch.
Using Date.toDateString()
You can learn more about toDateString
in documentation.
var ts = new Date(1733355010000);
console.log(ts.toDateString());
# Thu Dec 5 2024
Using Date.toISOString()
You can learn more about toISOString
in documentation.
var ts = new Date(1733355010000);
console.log(ts.toISOString());
# %2024-12-05T00:30:10+01:00