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

292
Views
How to know what today is, in discord.js

I want to make bot that know what day is today, i have example code below but i dont know how to fix this.

  client.on("message", msg =>{
  if (msg.content === "!today"){
    If (Today is Sunday){
        msg.reply("Time to Holiday")
      }
    else if(Today is monday){
        msg.reply("Time to work")
      }
  }
 });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

new Date() gives you the current date and time. It has a method .getDay() which gives you the day of the week as a number. Sunday is 0; Monday is 1. So:

const dayOfWeek = new Date().getDay();

if (dayOfWeek === 0) { // is it Sunday?

Note that this is the bot server date and time. Different users might be on different days, due to time zones.

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!