@chevre/domain
Version:
Chevre Domain Library for Node.js
23 lines (17 loc) • 737 B
text/typescript
// tslint:disable:no-console
import * as moment from 'moment';
const eventStartDate = '2025-04-10T01:00:00Z';
// const timeFormat = 'HH:mm:ssZ';
const time = '00:00:00+09:00';
// const time = '00:00:00Z';
// tslint:disable-next-line:no-magic-numbers
const offset = time.slice(8);
console.log('offset:', offset);
// const opensMoment = moment(time, timeFormat, true);
// const utcOffset = opensMoment.utcOffset();
// const eventStartDateMoment = moment.utc(eventStartDate);
const eventStartDateMoment = moment(eventStartDate, true);
console.log(eventStartDateMoment);
console.log(eventStartDateMoment.utcOffset(offset));
const usageDate = moment(`${eventStartDateMoment.format('YYYY-MM-DD')}T${time}`, true);
console.log(usageDate);