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

160
Views
Typescript da un año equivocado ridículo en la nueva función Date ()

Realmente me estoy tirando del pelo ahora y me estoy volviendo loco:

 const {year, month} = req.headers; const date_range_from = new Date(year, month, 1); const date_range_to = new Date(year, month + 1, 1); // wrong year; why? console.log("year, month: ", year, month) console.log("date_range_from, date_range_to: ", date_range_from, date_range_to)

El registro de la consola da:

 year, month: 2021 6 date_range_from, date_range_to: 2021-06-30T15:00:00.000Z 2026-01-31T15:00:00.000Z

¿POR QUÉ 2026???? ¿¿¿Qué está pasando???

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