Hi i have added a date time picker in a page.
But after using the datepipe
to convert it to date time, it is returning wrong date and time
Find below my code :-
HTML
<ion-item id="datePick" no-lines>
<ion-label [class]="dateClass">Choose pick up date to continue</ion-label>
<ion-datetime min="{{minDate}}" displayFormat="MMM DD, YYYY HH:mm" [(ngModel)]="myDate" ></ion-datetime>
</ion-item>
TS
let convertedDate =this.datepipe.transform(this.myDate, 'MM/dd/yyyy hh:mm a');
convertedDate
is providing incorrect date time.
Please help me fix this issue . What am i doing wrong ? Is there any other way to convert date time ?