typescript - 如何使用日期管道以角度格式化日期数组?
问题描述
我有一系列日期,就像
[
"2019-06-17 09:21:20+05:30",
"2019-06-18 09:21:20+05:30",
"2019-06-19 09:21:20+05:30",
"2019-06-20 09:21:20+05:30"
]
如何使用 datepipe 将其转换为日期时间。
解决方案
import the DatePipe to your app.module file import { DatePipe} from '@angular/common'
and format your date objects using this Pre-defined format options
and include this code to your app.component.html page
{{ DateObjectValue | date:'medium'}}
see the attached stackblitz example link : FormatDateExample
推荐阅读
- html - Flex:使孩子具有相同高度的绝对兄弟姐妹
- tfs - 如何使用 Web 代理配置 TFS 构建代理
- css - 未应用 CSS 变量
- java - 如何从接受泛型枚举的方法返回泛型枚举?
- python - 在 Pandas 数据框中显示字符串
- spring-boot - ServletRequestParameter 异常,参数不存在
- ssas - 在 SQL 探查器中设置什么来调查 SSAS 多维数据集同步作业挂起?
- python - 即使使用 Dropout、L2 和更多数据,验证准确度(LeNet-5)也没有提高
- azure - 差异 - 非典型旅行、不可能旅行、不熟悉的登录
- mysql - 如何在不加入 Node.js 的情况下更新两个表?