“Konvertieren Sie UTC in CST -Datum TimeFormat JavaScript” Code-Antworten

JavaScript -Datum des UTC -Formats

new Date().toISOString()
> '2012-11-04T14:51:06.157Z'
VoiceTechGuy

Konvertieren Sie UTC auf JavaScript, um zu datieren

var UTCdate = new Date('4/29/2021 3:22:46 PM UTC');
var onlyDate = UTCdate.getDate();
console.log(onlyDate); //Gives 29

//Please don't forget to upvote if this answer helped you ! Have a nice day !!
Powerful Polecat

Konvertieren Sie UTC in CST -Datum TimeFormat JavaScript

// construct a moment object with UTC-based input
var m = moment.utc(new Date('2015-01-01 00:00:00'));

// convert using the TZDB identifier for US Central time
m.tz('America/Chicago');

// format output however you desire
var s = m.format("YYYY-MM-DD HH:mm:ss");
Helpless Hamerkop

Ähnliche Antworten wie “Konvertieren Sie UTC in CST -Datum TimeFormat JavaScript”

Fragen ähnlich wie “Konvertieren Sie UTC in CST -Datum TimeFormat JavaScript”

Weitere verwandte Antworten zu “Konvertieren Sie UTC in CST -Datum TimeFormat JavaScript” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen