Is there a built in filter in angular to convert my unix timestamp to a human readable date format?
I have tried the following:
{{ ::time | date:"medium" }}
But it gives wrong results:
1232346882 gives Jan 15, 1970 7:19:06 AM
How can I fix that?
You need to convert seconds to milliseconds... Try it with 1232346882000
.
{{ 1232346882000 | date:"medium" }}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.