Formatting Angular Data

0

Hello, I have the following string:

Tue Oct 16 2018 00:00:00 GMT-0300 (-03)

And I wanted to format it in dd/mm/yyyy and my goal and stay 16/10/2018

How would I have to do this formatting process?

    
asked by anonymous 16.10.2018 / 22:01

1 answer

0

If you have a recent version (5.5 ahead if I'm not mistaken), as exemplified in pipes documentation , you you need to use pipes this way:

<p>The hero's birthday is {{ birthday | date:"MM/dd/yy" }} </p>

In your case it would be

<p> Data atual é {{ data | date:"dd/MM/yyyy" }} </p>
    
16.10.2018 / 22:58