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

291
Views
Moment js: What is the different between moment(date:string, format:string) to moment(date:string).format(format:string)?

I want to know what is the different between:

moment('2021-12-12', 'YYYY-MM-DD')

to this one:

moment('2021-12-12).format('YYYY-MM-DD)

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

0

When you use the format method in moment, you convert the date to the string with the desired format. But when you pass the desired format as the second argument to the moment method, you do not actually convert the data type. But you want that your date to be in a written format. This is a big difference between first option and second option that you wrote.

For more info you can read this

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!