Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70754

Date picker returning incorrect date time

$
0
0

@emiljenson wrote:

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 ?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70754

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>