“Convertir UTC a CST Date TimeFormat JavaScript” Código de respuesta

Fecha de JavaScript al formato UTC

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

convertir UTC hasta la fecha JavaScript

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

Convertir UTC a CST Date 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

Respuestas similares a “Convertir UTC a CST Date TimeFormat JavaScript”

Preguntas similares a “Convertir UTC a CST Date TimeFormat JavaScript”

Más respuestas relacionadas con “Convertir UTC a CST Date TimeFormat JavaScript” en JavaScript

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código