# Popup calendar default value

**URL:** <https://forum.inductiveautomation.com/t/popup-calendar-default-value/17359>\
**Category:** Ignition\
**Created:** [March 14, 2018, 3:41am UTC](https://forum.inductiveautomation.com/t/popup-calendar-default-value/17359 "2018-03-14T03:41:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mel](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Mel](https://forum.inductiveautomation.com/u/Mel)\
**Post date:** [March 14, 2018, 3:41am UTC](https://forum.inductiveautomation.com/t/popup-calendar-default-value/17359/1 "2018-03-14T03:41:49Z")

</div>

Is there any function on pop up calendar that will set current date time value on this component. Like for example I have button that will trigger to the component on popup calendar and display the current date and time.

I’m thinking something like this on python:

event.source.parent.getComponent(‘myDate’).date = datetime.datetime.now()

but it give’s me an error saying that it can’t convert the date.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 14, 2018, 12:26pm UTC](https://forum.inductiveautomation.com/t/popup-calendar-default-value/17359/2 "2018-03-14T12:26:45Z")

</div>

Try:

```auto
event.source.parent.getComponent('myDate').date = system.datetime.now()

```

Although jython tries hard to make jython-java conversions seamless, it isn’t perfect. Ignition’s script function `now()` yields the proper `java.util.Date` datatype.
