AngularJS. Convert tag value (Unix time to human-readable time)

前端 未结 6 1147
萌比男神i
萌比男神i 2020-12-01 03:37

I am getting data from a database and displaying it:

    
  • {{item.date}}
6条回答
  •  萌比男神i
    2020-12-01 03:56

    There is directive to that called rsTime.

        
    

    Check demo at Plunker .

    Below are different formates of time:

     M/d/y -  11/7/2016
    
     HH:mm:ss - 16:02:31 (24hrs formate)
    
     hh:mm:ss TT - 04:03:10 PM
    
     ffffd MMM d h:mm TT  - Mon Nov 7 at 4:04 PM
    

    For documentation visit Github

提交回复
热议问题