Timestamp To Date Converter
Convert timestamp to date or date to timestamp easily
How To Get Current Date And Time in JavaScript
If you want to get current date and time in human readable format, you have to initialize Date
object,
which is by default initialize for current timestamp. Then, you can convert it to any format that you like.
Javascript provides multiple functions to present Date
in human readable form. They are:
- toDateString
- Converts the date portion of a Date object into a readable string
- toGMTString
- Deprecated. Use the toUTCString() method instead
- toISOString
- Returns the date as a string, using the ISO standard
- toJSON
- Returns the date as a string, formatted as a JSON date
- toLocaleDateString
- Returns the date portion of a Date object as a string, using locale conventions
- toLocaleTimeString
- Returns the time portion of a Date object as a string, using locale conventions
- toLocaleString
- Converts a Date object to a string, using locale conventions
- toString
- Converts a Date object to a string
- toTimeString
- Converts the time portion of a Date object to a string
- toUTCString()
- Converts a Date object to a string, according to universal time
toDateString()
You can learn more about toDateString
in documentation.
var ts = new Date();
console.log(ts.toDateString());
# Tue Nov 19 2024
toISOString()
You can learn more about toISOString
in documentation.
var ts = new Date();
console.log(ts.toISOString());
# %2024-11-19T03:45:03+01:00
Other Functions
var ts = new Date();
Tags
Related Articles
- How To Convert Timestamp To Date and Time in JavaScript
- How To Get Current Timestamp In JavaScript
- Timestamp To Date
- How To Convert Timestamp To Date and Time in Python
- How To Get Current Time In Python
- How To Get Current Timestamp In Bash
- How To Get Current Timestamp In Java
- How To Get Current Timestamp In PHP
- How To Get Current Timestamp In Python