Date.now();
I want to convert the timestamp to readable format
e.g "Fri Nov 17 2017 19:15:15 GMT+0800 (Malay Peninsula Standard Time)"
var date = new Date();
console.log(date.toLocaleDateString());
console.log(date.toDateString());
console.log(date.toGMTString());
Choose your method from here: https://www.w3schools.com/js/js_date_methods.asp
You could do these following statements
let newDate = new Date(Date.now());
console.log(`${newDate.toDateString()} ${newDate.toTimeString()}`);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With