Convert UTC time to local time when using DateTime and displaying date


#1

Hi everyone
I have an issue with displaying the time in my app

I’m using ion-datetime like this
<ion-datetime displayFormat="MMM DD, YYYY HH:mm" [(ngModel)]="postData.due_date" placeholder="Due Date"></ion-datetime>
But it does not show my local time, it shows UTC time which is +3 of my local time

when data inserted to the database, it’s inserted like this
2017-12-11T10:10:00Z

Same date and time I have picked in ion-datetime

And when displaying it by using
{{item.due_date | date: 'yyyy-MM-dd HH:mm'}}

It gives me +3 of the time inserted in the database
2017-12-11 13:10

So, the problem is when picking the date and time using ion-datetime, it show UTC not local

Hope you understand my issue
Thank you