Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

400
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda