我從數據庫中獲取下一個對象:{ createdAt: { timezone : [...], timestamp: 'date value in timestamp' }}我需要使用 Angular 6 打印 HTML 中的createdAt 屬性,所以我嘗試下一步: {{obj.createdAt | date}}但出現下一個錯誤: invalidPipeArgument: 'Unable to convert "[object Object]" into a date' for pipe 'DatePipe'嘗試使用此語句調試此屬性,{{obj.createdAt | json}}我得到一個長 json 對象,如下所示:{ "timezone": { "name": "Europe/Berlin", "transitions": [..Long content here..]}?如何打印正確的日期時間?我在后端和 mysql 數據庫中使用 Symfony 和 Doctrine。屬性 CreatedAt 是具有以下值的 DateTime:
Angular DatePipe 打印日期時間
Cats萌萌
2023-08-24 15:58:13