I have the following question.
When I new a date and insert into one of the field in my collection.
The new date is a number. ACTUALLY, when I mouse over the field in the collection.
There is a blue word which can automatically convert the number to UTC format.
Is there anything I can insert the data in UTC format without this manual procedure.
Hope someone can help.
var now = new Date();
var utc_timestamp = Date.UTC(now.getUTCFullYear(),now.getUTCMonth(), now.getUTCDate() ,
now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds(), now.getUTCMilliseconds());
//$w(‘#text30’).text = timeDiff.toLocaleString();
let Jinsert = {
“name”: (buttonname),
“start”: utc_timestamp
}
wixData.insert(“AttendDB”, Jinsert)
.then((results) => {
// item = results; //see item below
})
. catch ((err) => {
let errorMsg = err;
});