Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

359
Vistas
How to get the the createdAt timestamp without 'GMT+0000 (Coordinated Universal Time)'?

I have searched everywhere for this but I haven't got the right answer. I just want to set it without the CUT time.

{name: "Registered:", value: `${user.createdAt}`},
    
{name: "Joined:", value: `${message.guild.joinedAt}`}

It currently shows up like this: click here to see.

Is there any way to remove it?

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Assuming the properties are JS Date instances, you can use one of these functions to do it:

function formatDateV1 (date) {
  return date.toLocaleString(undefined, {dateStyle: 'medium', timeStyle: 'medium', hour12: false});
}

function formatDateV2 (date) {
  return `${date.toDateString()} ${date.toTimeString().slice(0, 8)}`;
}

const date = new Date();
const user = {createdAt: date};
const message = {guild: {joinedAt: date}};

const registerV1 = {name: "Registered:", value: formatDateV1(user.createdAt)};
console.log('registerV1', registerV1);

const joinV1 = {name: "Joined:", value: formatDateV1(message.guild.joinedAt)};
console.log('joinV1', joinV1);

const registerV2 = {name: "Registered:", value: formatDateV2(user.createdAt)}
console.log('registerV2', registerV2);

const joinV2 = {name: "Joined:", value: formatDateV2(message.guild.joinedAt)}
console.log('joinV2', joinV2);

about 4 years ago · Juan Pablo Isaza Denunciar

0

Yes it's possible to remove it

   {name: "Registered:", value: `${user.createdAt.toDateString()}`},
        
   {name: "Joined:", value: `${message.guild.joinedAt.toDateString()}`}

You should to add toDateString() to avoid the GMT or CUT time

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda