Angular4_时间显示时分 AM/PM

前端之家收集整理的这篇文章主要介绍了Angular4_时间显示时分 AM/PM前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

<td>{{item.timeSlot| date:'h:mm a'}}</td>


How To Use

date_expression | date[:format[:timezone[:locale]]]

Description

Where:

  • expressionis a date object or a number (milliseconds since UTC epoch) or an ISO string (https://www.w3.org/TR/NOTE-datetime).
  • formatindicates which date/time components to include. The format can be predefined as shown below (all examples are given foren-US) or custom as shown in the table.

    • 'short': equivalent to'M/d/yy,h:mm a'(e.g.6/15/15,9:03 AM)
    • 'medium': equivalent to'MMM d,y,h:mm:ss a'(e.g.Jun 15,2015,9:03:01 AM)
    • 'long': equivalent to'MMMM d,h:mm:ss a z'(e.g.June 15,2015 at 9:03:01 AM GMT+1)
    • 'full': equivalent to'EEEE,MMMM d,h:mm:ss a zzzz'(e.g.Monday,June 15,2015 at 9:03:01 AM GMT+01:00)
    • 'shortDate': equivalent to'M/d/yy'(e.g.6/15/15)
    • 'mediumDate': equivalent to)
    • 'longDate': equivalent to'fullDate': equivalent to'shortTime': equivalent to'h:mm a'(e.g.9:03 AM)
    • 'mediumTime': equivalent to'h:mm:ss a'(e.g.9:03:01 AM)
    • 'longTime': equivalent to'h:mm:ss a z'(e.g.9:03:01 AM GMT+1)
    • 'fullTime': equivalent to'h:mm:ss a zzzz'(e.g.9:03:01 AM GMT+01:00)
  • timezoneto be used for formatting. It understands UTC/GMT and the continental US time zone abbreviations,but for general use,use a time zone offset,for example,'+0430'(4 hours,30 minutes east of the Greenwich meridian) If not specified,the local system timezone of the end-user's browser will be used.
  • localeis astringdefining the locale to use (uses the currentLOCALE_IDby default)
原文链接:https://www.f2er.com/angularjs/144991.html

猜你在找的Angularjs相关文章