加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

Angular4_时间显示时分 AM/PM

发布时间:2020-12-17 08:23:56 所属栏目:安全 来源:网络整理
导读:td {{item.timeSlot| date:'h:mm a'}} / td How To Use date_expression | date[:format[:timezone[:locale]]] Description Where: expression is a date object or a number (milliseconds since UTC epoch) or an ISO string (https://www.w3.org/TR/NOTE-

<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)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读