Skip to content
Advertisement

Luxon is failing to parse this date format

I’m trying to figure out why luxon is failing to parse this date format.

This is the original value I have: 2019-04-23T23:15:07.910Z.

What format is this (it looks like an iso format).

Code snippet:

JavaScript

Output from snippet above:

JavaScript

Advertisement

Answer

Ahh just figured it out. Turns out 2019-04-23T23:15:07.910Z is actually a javascript date object.

This means I needed to do const fromJSDate = DateTime.fromJSDate(document.lastUpdatedAt)

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement