71597

Question:
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
Answer1:I highly recommend using <a href="http://momentjs.com/docs/#/use-it/typescript/" rel="nofollow"><strong>momentJs</strong></a> with your Ionic 3
app.Then you won't have any browser specific errors like you have now.
npm install moment
</blockquote><em>.ts</em>
import moment from 'moment';
let now = moment().format('LLLL');
<strong>Update:</strong>
moment("02:00 PM", "h:mm A").format("HH:mm") // "14:00"
Answer2:You can do like this ` {{start_timestamp | date:'HH:mm a'}}
Answer3:in ts file start_timestamp = 1500536460;
print like this in html <p class="timeLabel">{{start_timestamp | date:'YYYY-MM-DD H:m:s z'}}