Want to show my system time in date picker but it shows 5hours before


#1

I want to show my system time in date picker but it shows time 5:30 hours less than my system time. I tried with this.dailyactivity.date = new Date().toISOString(); it gets my system time in CONSOLE but not in the picker.

    <ion-item>
        <ion-label>From</ion-label>
        <ion-datetime displayFormat="HH:mm" pickerFormat="DD/MMM/YYYY HH:mm" [(ngModel)]="dailyactivity.date"></ion-datetime>
    </ion-item>  

this.dailyactivity.date = new Date().toISOString(); alert('time:'+this.dailyactivity.date)


#2

use moment to achieve it


#3

Thank Mr.Kocei it works with moment JS