Issue
I want to format the UTC datetime to 'dd/MM/yyyy hh:mm:ss a'. I tried this using the datepipe. However it converts it to the localtime. How can I format UTC to the required format.
Stackblitz link: https://stackblitz.com/edit/angular-oxr43w
Thanks in advance.
Solution
Date pipe accepts a timezone check the docs
<p>
UTC: {{date | date:"dd/MM/yyyy hh:mm:ss a":"+0000"}}
</p>
Answered By - Danil Gudz
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.