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

272
Views
Is there a way to set the timestamp to UTC in discord.js

I wanted to create a footer for a discord embed, that has UTC time so I created the lines in the following, and then it errored a lot, so I turned it into an object / {}. Then I got this " if (typeof data !== 'string') throw new error(errorMessage); ^ RangeError [EMBED_FOOTER_TEXT]: MessageEmbed footer text must be a string. at reply (C:\Users\Eb482\OneDrive\Desktop\bot\app.js:219:10)" here is my code

 let embed = new MessageEmbed()
        .setColor('RANDOM')
        .setThumbnail(serverIcon)
        .setTitle(message)
        .setFooter({name: new Date(Date.now()).toISODateString})
        .setAuthor(author1);
    if (Fields) embed = embed.setFields(Fields);
    if (EmbedFile) embed = embed.setImage(EmbedFile);
    interaction.reply({ embeds: [embed], ephemeral: ephemeral, components: components });
}

Please if anyone knows how to fix the error let me know.(on discord v13)

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

add .setTimestamp(); after the setAuthor, it would show the user their local time

let embed = new MessageEmbed()
    .setColor('RANDOM')
    .setThumbnail(serverIcon)
    .setTitle(message)
    .setFooter({name: new Date(Date.now()).toISODateString})
    .setAuthor(author1)
    .setTimestamp();
if (Fields) embed = embed.setFields(Fields);
if (EmbedFile) embed = embed.setImage(EmbedFile);
interaction.reply({ embeds: [embed], ephemeral: ephemeral, components: components });

}

about 4 years ago · Juan Pablo Isaza Report

0

Message footer has no name attribute. It has text attr.

More on docs

about 4 years ago · Juan Pablo Isaza 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!