# Perspective date time input issue

**URL:** <https://forum.inductiveautomation.com/t/perspective-date-time-input-issue/38790>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [September 17, 2020, 10:41am UTC](https://forum.inductiveautomation.com/t/perspective-date-time-input-issue/38790 "2020-09-17T10:41:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vishwas.hirgude](https://avatars.discourse-cdn.com/v4/letter/v/e47c2d/32.png) [@vishwas.hirgude](https://forum.inductiveautomation.com/u/vishwas.hirgude)\
**Post date:** [September 17, 2020, 10:41am UTC](https://forum.inductiveautomation.com/t/perspective-date-time-input-issue/38790/1 "2020-09-17T10:41:04Z")

</div>

Hi everybody, i am using IGNITION 8.0.12.  
Having problem with datetime input.

1. when i select date and click on button then we get value from the datetime input but when I clear datetime input text and click on submit button still i get current date from datetime input i was expecting blank or NON.

I have validation that datetime input has selected date or not but in this case if i have not selected any date still i am getting current date.so i am not able to validate datetime Input.  
please suggest me solution.  
How do i check validation date input has text or its empty in script.

---

<div class="post-metadata">

**Author:** ![KMuldoon](https://avatars.discourse-cdn.com/v4/letter/k/839c29/32.png) [@KMuldoon](https://forum.inductiveautomation.com/u/KMuldoon)\
**Post date:** [September 18, 2020, 5:55pm UTC](https://forum.inductiveautomation.com/t/perspective-date-time-input-issue/38790/2 "2020-09-18T17:55:53Z")

</div>

Which component are you using? I’m wondering if you’re grabbing the unlatched datetime value instead of the latched datetime from your description.

---

<div class="post-metadata">

**Author:** ![vishwas.hirgude](https://avatars.discourse-cdn.com/v4/letter/v/e47c2d/32.png) [@vishwas.hirgude](https://forum.inductiveautomation.com/u/vishwas.hirgude)\
**Post date:** [September 20, 2020, 8:11am UTC](https://forum.inductiveautomation.com/t/perspective-date-time-input-issue/38790/3 "2020-09-20T08:11:52Z")

</div>

i am using DateTime Input component

---

<div class="post-metadata">

**Author:** ![KMuldoon](https://avatars.discourse-cdn.com/v4/letter/k/839c29/32.png) [@KMuldoon](https://forum.inductiveautomation.com/u/KMuldoon)\
**Post date:** [September 22, 2020, 11:08pm UTC](https://forum.inductiveautomation.com/t/perspective-date-time-input-issue/38790/4 "2020-09-22T23:08:03Z")

</div>

Ok, I was able to recreate your issue. There doesn’t seem to be a native way (at least that I can tell) to clear out the datetime value from the component. I was able to make a quick and dirty workaround that just cleared the DateTime Input component’s value and formattedValues when I pressed a button.

```auto
datetimeInput = self.getSibling("DateTimeInput").props
datetimeInput.value = None
datetimeInput.formattedValues.datetime = None
datetimeInput.formattedValues.date = None
datetimeInput.formattedValues.time = None

```

This way you can clear it out and know that your script will only grab valid datetimes or nulls

---

<div class="post-metadata">

**Author:** ![vishwas.hirgude](https://avatars.discourse-cdn.com/v4/letter/v/e47c2d/32.png) [@vishwas.hirgude](https://forum.inductiveautomation.com/u/vishwas.hirgude)\
**Post date:** [September 27, 2020, 5:07pm UTC](https://forum.inductiveautomation.com/t/perspective-date-time-input-issue/38790/5 "2020-09-27T17:07:01Z")

</div>

thanks for contributing.  
but issue is when i select date and then clear using delete button on keyboard and I click on button then i am getting current date.  
in this case I did not select any date because i have select date and then clear dTI input using delete button of keyboard.  
i am looking for solution like if i select date and then clear that date using delete button of keyboard at that i want datetimeInput.value would be None.or you can suggest me any solution which property i need to set for this or any component event of DTI on that i can write code to archive this.

Thanks
