$w.onReady(function () { let DataAtual = new Date(); let MEIA_Hora = 1800000 let UMA_Hora = 3600000 console.log("Data Atual: ", DataAtual); // converta a data atual para milisecundos let DataMilisec = new Date(DataAtual).getTime(); console.log("Data em Milisec: ", DataMilisec); // acresento 00:30 nos mili secundos e converto para data novamente let DataModificada = new Date(DataMilisec + MEIA_Hora); console.log("voltando ", DataModificada); //let currentTimeStamp = new Date().getTime(); });
top of page
Important forum update
This forum is migrating to one unified Wix community forum starting July 26th, and will be read-only during the process.
Wishlist Page is the official platform for requesting new features. You can vote, comment, and track the status of the requested features.
bottom of page
If you are doing the get time method then you can just add the result of the get time with total number of milliseconds (deriving from "x" hours). OR you can do a quick one line and do this:
console.log(new Date().addHours(4).toLocaleString(), '4 hours from now')
You can turn the console log to a function if you would like and remove the "toLocaleString() "for the UTC time.