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

164
Views
How to get a ISO 8601 string like how Moment formats it with the native API?

If I run...

moment().format();

I get back 2022-05-25T16:47:05-04:00

But if I use the native browser Date API toISOString() it's not quite the same as Moment...

new Date(Date.now()).toISOString()

This comes back as 2022-05-25T20:47:05.698Z

How can I get the Date API to return the ISO string in the same format that moment defaults to? The documentation for both says it uses ISO 1806, but yet they are slightly different.

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!