Typescript Invalid date with Ionic 3 simulator and Firefox
问题 I have this function with MomentJs CreateFormat(date: string, time: string): string { let now = moment(date + " " + time, "YYYY-MM-DD H:m:s z").toDate(); return moment(now, "YYYY-MM-DD H:m:s z").format("HH:mm"); } I got this result : 7:39 pm i want to display it like this 19:39 回答1: I highly recommend using momentJs with your Ionic 3 app.Then you won't have any browser specific errors like you have now. npm install moment .ts import moment from 'moment'; let now = moment().format('LLLL');