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

203
Views
How to solve date formatting issue with date-fns

I'm using date-fns to format my date. But a strange thing is happening: if you input today's date as 20/07/2022, it automatically subtracts one minus. That is, the date is 19/07/2022. So the problem is that every time I enter a date, my form receives it by subtracting -1. Can you tell me how to solve this problem?

 const newDate =  format(
      new Date(date),
      'dd MMM yyyy',
      {
        locale: ptBR,
      }
    )
about 4 years ago · Santiago Trujillo
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!