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

180
Views
Comparing two different dates using moment with existing date string?

Even the value I set for the time in the moment.js timezones same following two different approaches the value of the date returned is different

  1. moment("02:00","HH:mm").tz('America/Chicago').format()

returns 2022-03-31T15:30:00-05:00

  1. moment().tz('America/Chicago').set({hour:"02",minute:"00"})

returns 2022-04-01T02:00:02-05:00

And if I have a date string 2022-03-30T08:13:44.478+00:00 which I want to convert to specific time zones as below

moment(`2022-03-30T08:13:44.478+00:00`).tz('America/Chicago')

is it the right way if I want to compare it with the current date of that timezone?

moment(`2022-03-30T08:13:44.478+00:00`).tz('America/Chicago').isSameOrAfter(moment().tz('America/Chicago'))
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!