# Perspective Date Time Input

**URL:** <https://forum.inductiveautomation.com/t/perspective-date-time-input/34442>\
**Category:** Ignition\
**Created:** [May 5, 2020, 1:21pm UTC](https://forum.inductiveautomation.com/t/perspective-date-time-input/34442 "2020-05-05T13:21:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bebel](https://avatars.discourse-cdn.com/v4/letter/b/43a26b/32.png) [@bebel](https://forum.inductiveautomation.com/u/bebel)\
**Post date:** [May 5, 2020, 1:21pm UTC](https://forum.inductiveautomation.com/t/perspective-date-time-input/34442/1 "2020-05-05T13:21:38Z")

</div>

using v8.0.12  
There seems to be a glitch with 31 day months. I have a datetimeinput. on a popup. If Jan 31st is chosen, it displays Jan 31, 2020 11:00 PM. (I really just want it to display a month and year but I can’t since this is on a popup and the whole date picker stuck behind the popup bug hasn’t been fixed. But I digress) I then have code to grab the date from the input but it is wrong.

```
date = self.getSibling("DateTimeInput").props.value
m = system.date.getMonth(date) + 1
y = system.date.getYear(date)
myds.Log(system.date.format(date, 'yyyy-MM-dd') + ' ' + str(m))
myds.Log(self.getSibling("DateTimeInput").props.formattedValues.datetime)

```

myds is just the name of the global script library where I take care of logging for debugging purposes

This logs:  
2020-02-01 2  
Jan 31, 2020 11:00 PM

How is the date derived from the value reading Feb but the formatted and display values reading January?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [May 5, 2020, 2:59pm UTC](https://forum.inductiveautomation.com/t/perspective-date-time-input/34442/2 "2020-05-05T14:59:42Z")

</div>

I have good news and I have better news:

Good news: It looks like this was fixed due to some recent changes we made to the DateTime Input. I’m using a nightly from 8.0.13 from about a week ago and using your script (modified to use my logging) I see this:

```auto
07:49:33.376 [Browser Events Thread] INFO Perspective.Designer.BrowserConsole - 2020-01-31 1
07:49:33.376 [Browser Events Thread] INFO Perspective.Designer.BrowserConsole - Jan 31, 2020

```

Better News:  
The changes we made seem to also have fixed the Picker-Behind-the-Popup issue, even while using custom formats…  
 ![Screen Shot 2020-05-05 at 7.54.33 AM](https://us1.discourse-cdn.com/inductiveautomation/original/2X/9/9549bb73df35bf576473bcf076067c907856cbf2.png)

You should probably note that we’ve deprecated the `props.formattedValues.datetime` property going forward. The recommended usage is to supply your format (probably “M/YYYY” for your use-case) and then use `props.formattedValue`.
