Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

398
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!