n8n/packages/core/src/utils.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

6 lines
189 B
TypeScript
Raw Normal View History

import { DateTime } from 'luxon';
export function toUtcDate(datetime: Date, tz: string) {
return DateTime.fromISO(datetime.toISOString().slice(0, -1), { zone: tz }).toUTC().toJSDate();
}