Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
121
rated 0 times [  124] [ 3]  / answers: 1 / hits: 16963  / 8 Years ago, thu, january 19, 2017, 12:00:00

I have a date string 2017-01-19 10:34:36, it's coming from API.



I want to display it in HH:MM AM format in Ionic


More From » angularjs

 Answers
12

To display datetime, you can just do it in angular2 way, using a pipe. Angular2 provides a DatePipe. You can use it like this:



{{info.createdDate | date: yyyy/MM/dd HH:mm:ss}}


[update]



If you want to display as format 'HH:MM AM', just use:



{{info.createdDate | date: shortTime}}


will be fine.


[#59290] Tuesday, January 17, 2017, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rhettforrestm

Total Points: 468
Total Questions: 106
Total Answers: 88

Location: Finland
Member since Sat, Nov 6, 2021
3 Years ago
;