0

I want to convert 2019-08-08T20:41:00-1000 to MMM dd, yyyy, hh:mm a z(Aug 08, 2019, 08:41 PM HST) format. I did not find any solution for this.. please help me out

I tried to get offset from that date and converting to date object but it is always showing aug 09, 2019, 12:32 PM GMT+5. which is wrong output...

expected Output is Aug 08, 2019, 08:41 PM HST

2 Answers2

0

Try using angular's date pipe.

{{ value_expression | date [ : format [ : timezone [ : locale ] ] ] }}

https://angular.io/api/common/DatePipe

Sam
  • 1,736
  • 8
  • 15
0

I followed this link How can I deal with the timezone issue with the Angular 4 date pipe? it solves my issue {{ competition.compStart | date: 'short' : '-120'}}