DEV Community

loading...

Discussion on: You probably don't need Moment.js

Collapse
codingsafari profile image
Nico Braun • Edited

You can also use this for local time

new Date().toLocaleTimeString('en-gb', {
  hour12: false,
  hour: 'numeric',
  minute: 'numeric'
})

There are many others, like toISOString for example.

Forem Open with the Forem app