I am using the following date pipe for formatting date using date-fns library
date.pipe.ts
import { Pipe, PipeTransform } from '@angular/core';
import { format } from 'date-fns';
@Pipe({
name: 'formatDate'
})
export class FormatDatePipe implements PipeTransform {
transform(value: string | number | Date, dateFormat: string): string {
return format(value, dateFormat);
}
}
component.html
<h1> {{ startDate | formatDate: 'DD-MM-YYYY HH:mm:ss.SSSZ' }} </h1>
I am getting the following output
output
01-01-2021 07:09:00.000-05:00
but I am trying to get the exact time zone instead of just -05:00, for example, in this case (UTC-5) Expected output
01-01-2021 07:09:00.000 (UTC-5)