hi masters, i have a timestamp 1634871600 and i need to show (console.log() for example) a human date (10/11/2021) or 10 nov 2021
can you help me?
hi masters, i have a timestamp 1634871600 and i need to show (console.log() for example) a human date (10/11/2021) or 10 nov 2021
can you help me?
$w.onReady(function () {
let timeStamp = 1634871600
let dateString = new Date(timeStamp).toDateString();
console.log("Date-String: ", dateString);
let localeDateString = new Date(timeStamp).toLocaleDateString();
console.log("Date-String: ", localeDateString);
let localeString = new Date(timeStamp).toLocaleString();
console.log("Date-String: ", localeString);
let localeTimeString = new Date(timeStamp).toLocaleTimeString();
console.log("Date-String: ", localeTimeString);
let timeString = new Date(timeStamp).toTimeString();
console.log("Date-String: ", timeString);
});
Expected-OUTPUT:

Sorry, forgot to change the OUTPUT-TITLES, but i think it is also clear shown in example how it works.
ooohhhh i will try thanks a lot broth
thanks master for your help. i do this and “return different date”.
what do you think?
var integer = parseInt ( phone [ 5 ], 10 ); //coming from sheet array
let timeStamp = integer ; // timestamp 1639364400
let dateString = new Date ( timeStamp ). toDateString ();
$w ( ‘#fechavuelot’ ). text = dateString ; // print Mon Jan 19 1970
console . log ( timeStamp )
Your TimeStamp is wrong! Or to be more precise → WRONG-FORMAT!
Your Time-Stamp is in SECONDS !
1636525330
Try instead this one: (TimeStamps are normaly in Milliseconds )
1636525330000
solved with, thanks a lot
let timeStamp = integer * 1000 ;