Answers for "toLocalIsoString() vs toIsoString()"

C#
0

toLocalIsoString() vs toIsoString()

var date = new Date(); // Or the date you'd like converted.
var isoDateTime = new Date(date.getTime() - (date.getTimezoneOffset() * 60000)).toISOString();
Posted by: Guest on February-02-2021
0

toLocalIsoString() vs toIsoString()

var tzoffset = (new Date()).getTimezoneOffset() * 60000; //offset in milliseconds
var localISOTime = (new Date(Date.now() - tzoffset)).toISOString().slice(0, -1);
// => '2015-01-26T06:40:36.181'
Posted by: Guest on February-02-2021

C# Answers by Framework

Browse Popular Code Answers by Language