date-time-picker
date-time-picker copied to clipboard
UTC format without momentjs
Example
https://stackblitz.com/edit/angular-zopu43

Question
Is it possible to set the formatted date to utc, not local time?
I'm not sure if there is a way to do this automatically or not. Manually you can subscribe to the
<input (dateTimeChange)="dateTimeChangeInternally($event)"
and then add the timezone offset to the selected date
public dateTimeChangeInternally(e: {
source: OwlDateTimeInputDirective<any>;
value: Date[];
input: HTMLElement;
}): void {
const startDate = e.value[0];
const utcDate = startDate.addMilliseconds(startDate.getTimezoneOffset() * 60 * 1000);
}
addMilliseconds does not exist for type date. Also why are you adding the offset?