# Ion-datetime get set value

**URL:** <https://forum.ionicframework.com/t/ion-datetime-get-set-value/237044>\
**Category:** Ionic Framework\
**Created:** [October 16, 2023, 8:38am UTC](https://forum.ionicframework.com/t/ion-datetime-get-set-value/237044 "2023-10-16T08:38:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![torstaero](https://avatars.discourse-cdn.com/v4/letter/t/e19adc/32.png) [@torstaero](https://forum.ionicframework.com/u/torstaero)\
**Post date:** [October 16, 2023, 8:38am UTC](https://forum.ionicframework.com/t/ion-datetime-get-set-value/237044/1 "2023-10-16T08:38:08Z")

</div>

Is there a way to access (get & set) the value of ion-datetime?

With `(ionChange)` i can get the value after it changes.

ngModel does not work ☹

The documentation shows nothing to access the value of an ion-datetime ☹ …only the event let me access the value.

---

<div class="post-metadata">

**Author:** ![ciccilleju](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ciccilleju/32/135142_2.png) [@ciccilleju](https://forum.ionicframework.com/u/ciccilleju)\
**Post date:** [October 16, 2023, 12:51pm UTC](https://forum.ionicframework.com/t/ion-datetime-get-set-value/237044/2 "2023-10-16T12:51:54Z")

</div>

what do you mean exactly?  
you can set it with [value]=“your\_variable\_or\_your\_value”

---

<div class="post-metadata">

**Author:** ![torstaero](https://avatars.discourse-cdn.com/v4/letter/t/e19adc/32.png) [@torstaero](https://forum.ionicframework.com/u/torstaero)\
**Post date:** [October 17, 2023, 7:47am UTC](https://forum.ionicframework.com/t/ion-datetime-get-set-value/237044/3 "2023-10-17T07:47:13Z")

</div>

Thanks, you are right. There is [value].  
ion-datetime sets an initial value. I would like to have that.  
I could set a date myself and take that. But it would be cleaner with a getter of ion-datetime.
