How to pick a date using ion-date-time tag


Hi, i am trying to pick a

					<ion-col text-right>
						<ion-label> <b> Rent To Be Paid At : </b></ion-label>
					<ion-col text-left>
							<ion-col col-4>
								<ion-datetime name="rentPayDate" displayFormat="DD" [(ngModel)]="rentPayDate"> </ion-datetime>
							<ion-col col-8>
								<ion-label>/ currentMonth /CurrentYear </ion-label>

I am able to pick a days date but when i try to display it on to my console i get a empty value. rentPayDate: ""
this is the date selector

this id my console

this is my ts file

		console.log("rent pay date",this.rentPayDate)


export class demo{


      this.rentPayDate= new Date().toISOString();


// selected date store in rentPayDate variable.use like variable In .ts file

Ion-datetime format

check the updated question with images


First of all confirm that you have initialized “rentpaydate” in constructor as I have mentioned in my previous comment. Just do it and you will start getting values.