对于客户端,您可以使用 angular datepipe API 使其可读日期。否则你也可以使用moment。下面是示例@Component({ selector: 'date-pipe', template: `<div> <p>Today is {{today | date}}</p> <p>Or if you prefer, {{today | date:'fullDate'}}</p> <p>The time is {{today | date:'h:mm a z'}}</p> </div>`})// Get the current date and time as a date-time value.export class DatePipeComponent { today: number = Date.now();}你可以在这里查看他们的文档