Object:
const DateTime = luxon.DateTime;
userInfo = {
startDate: '14/03/2022',
startTime: '12:30',
offsetShort: 'EDT',
}
From the luxon docs I understood to get offset value, Have to use this method:
DateTime.fromObject(new Date(userInfo.startDate), {zone: 'America/New_York'}).toFormat('ZZ');
Will return the offset value like this: -05:00
Since, My api is not returning zone name(ex: America/New_York), I want to get offset value based the offset short name(i,e IST, EST,EDT). Any possibilities in luxon ??
Basically I need any of the below result based on offset short name(EDT/EST/IST):
DateTime.fromObject(new Date('14-03-2022'), {zone: 'EDT'}).toFormat('ZZ'); >> -05:00
**OR**
DateTime.fromObject(new Date('14-03-2022'), {zone: 'EDT'}).toFormat('ZZ'); >> America/New_York