Here is a snippet of Javascript/Typescript code that I have for converting a string into a Luxon DateTime:
import { DateTime } from 'luxon';
const x = '2023-10-27T01:00:57.830+00:00'
const y = DateTime.fromFormat(x, 'yyyy-MM-dd');
console.log('y = ', y)
When executed, it displays the following result:
y = DateTime {
ts: 1698282057830,
_zone: SystemZone {},
loc: Locale {
locale: 'en-US',
numberingSystem: null,
outputCalendar: null,
intl: 'en-US',
weekdaysCache: { format: {}, standalone: {} },
monthsCache: { format: {}, standalone: {} },
meridiemCache: null,
eraCache: {},
specifiedLocale: null,
fastNumbersCached: null
},
invalid: Invalid {
reason: 'unparsable',
explanation: `the input "2023-10-27T01:00:57.830+00:00" can't be parsed as format yyyy-MM-dd`
},
weekData: null,
c: null,
o: null,
isLuxonDateTime: true
}
I am seeking guidance on how to correctly convert this object. Any advice would be greatly appreciated!