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

147
Views
Get Date pattern from date string in JS

I have been searching for a library in JS where I get the output as date format pattern ('yyyy-mm-dd' or 'dd-mm-yyyy' or so on..) from a date as input. the date could be in string format or UNIX. i.e if we paas date in some dateFormat('2021-08-14') function then output would be yyyy-mm-dd or so on.

If anyone has any idea about this then please let me know I know I can achieve this with regex but I want a build library in JS. Thanks in advance

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

0

momentjs was the most popular for this but is no longer maintained, https://day.js.org/ or https://date-fns.org/ are good alternatives.

about 4 years ago · Juan Pablo Isaza Report

0

The Date prototype has a good function for this: Date.prototype.toDateString
If you create an instance of Date, then you can call toDateString on it, and you have your

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!