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

397
Vistas
How to access day and time in discord.js

3vilBot

See the image this discord bot shows the time the message was sent as footer of embed. Like the next day it changes from today to yesterday like how can i make this?

I wanna do basically the same use the time as a footer.

Please help me

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

So there's a method in Discord.js's MessageEmbed class, its called .setTimestamp().

.setTimestamp allows you to add a timestamp on your embed footer. Here's an example:

const {
    MessageEmbed
} = require('discord.js');

const exampleEmbed = new MessageEmbed()
    .setTitle("Example")
    .setTimestamp(); // This is what you need!

Read more about .setTimestamp here: https://discord.js.org/#/docs/main/stable/class/MessageEmbed?scrollTo=setTimestamp

over 4 years ago · Santiago Trujillo Denunciar

0

If you want to set the exactly time and day you have to use :

var d = new Date,
    dformat = [d.getMonth()+1,
    d.getDate(),
    d.getFullYear()].join('/')+' '+
    [d.getHours(),
    d.getMinutes(),
    d.getSeconds()].join(':');

You have to set the d in the line you want! If you want to add it in footer you do it like this :

.setFooter(d)
over 4 years ago · Santiago Trujillo 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