您可以为此使用Angular 的日期管道import { DatePipe } from "@angular/common";@Component({ selector: "my-date", templateUrl: "./date.component.html", providers: [DatePipe] // Add DatePipe as Provider})export class DateComponent { now: any = Date.now(); format: string = "medium"; // more formats are available inside the DatePipe Documentation constructor(private datePipe: DatePipe) {} // Initialize DatePipe inside the constructor get dateInGMT(): any { // 1st parameter is the date // 2nd parameter is the format // 3rd parameter is the time zone return this.datePipe.transform(this.now, this.format, "GMT"); } get dateInCEST(): any { return this.datePipe.transform(this.now, this.format, "CEST"); } get dateInCustom(): any { return this.datePipe.transform(this.now, this.format, "+0530"); }}你也可以这样做:medium是一种格式,CST是时区,或者您可以提供您想要的任何值。<pre>{{ now | date: 'medium' : 'CST' }}</pre>