Hi! I’m currently developing a project using Ionic and Firebase, but I can’t figure out how to send the value I get from the ion-datetime as a timestamp to firebase. It just appears to be a string on firebase and I need it to be timestamp so I can apply order to my data.
This is my ion-datetime HTML code:
<ion-item> <ion-label>Time to pick up:</ion-label> <ion-datetime displayFormat="HH:mm" hourValues="8,9,10,11,12,13,14,15,16,17,18,19,20,21,22" minuteValues="0,15,30,45" [(ngModel)]="pickup" name="pickup" required></ion-datetime> </ion-item>
In typescript I have this:
pickup: Date = new Date();
The value stored in pickup is the one that I send to firebase, but it appears as a string once I check on firebase.