Skip to content

TypeScript code snippet – angular change How date looks?

// use Angular DatePipe
{{ dateObj | date: 'format desired' }}

{{ dateObj | date:'shortDate' <or> 'M/d/yy' }}    // output is '1/25/21'
{{ dateObj | date:'mediumDate' <or> 'MMM d, y' }} // output is 'Jan 25, 2021'
{{ dateObj | date:'longDate' <or> 'MMMM d, y' }}  // output is 'January 25, 2021'
See also  Python code snippet - How to make input box if else statement in tkinter?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.