Alex Skotner
Alex Skotner

Reputation: 602

How do I convert a LocalDateTime to a JavaScript Date object with JS-Joda?

how do I convert a LocalDateTime Object from the @js-joda/core library to a standard JavaScript Date object?

Upvotes: 3

Views: 3200

Answers (1)

Alex Skotner
Alex Skotner

Reputation: 602

As @RobG mentioned in a comment import convert from '@js-joda/core' and you can use let date = convert(ZonedDateTime.now()).toDate(); to get a js date

Upvotes: 3

Related Questions