# How to perspective Date Time Input - default todays date, fixed time

**URL:** <https://forum.inductiveautomation.com/t/how-to-perspective-date-time-input-default-todays-date-fixed-time/53971>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [December 9, 2021, 8:37pm UTC](https://forum.inductiveautomation.com/t/how-to-perspective-date-time-input-default-todays-date-fixed-time/53971 "2021-12-09T20:37:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff.ryan](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jeff.ryan/32/25543_2.png) [@jeff.ryan](https://forum.inductiveautomation.com/u/jeff.ryan)\
**Post date:** [December 9, 2021, 8:37pm UTC](https://forum.inductiveautomation.com/t/how-to-perspective-date-time-input-default-todays-date-fixed-time/53971/1 "2021-12-09T20:37:50Z")

</div>

I have Date Time Inputs on a perspective view. I want to bind the .value to ‘today’s’ date with a fixed time, to show that way on loading. These are shift start and stop times. They both, (date and time) should be changeable, if the user wanted to select a different day/shift. I would just like to default this way on page load.

There is Tag historical data bound to them as the start and end date.

I can use now() to get current date, but then it gives me the current time too…  
the dateFormat I found in documentation:  
dateFormat(now(), ‘yyyy-MM-dd 00:00:00’) //Returns the current date, but forces the time to 00:00:00.

is not working. I’m getting an error and no date populated in the input.  
I’m wondering if there is another way, something doing wrong? Thanks much!

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [December 10, 2021, 11:31am UTC](https://forum.inductiveautomation.com/t/how-to-perspective-date-time-input-default-todays-date-fixed-time/53971/2 "2021-12-10T11:31:46Z")

</div>

So you want to turn now() into just date?

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [December 10, 2021, 12:33pm UTC](https://forum.inductiveautomation.com/t/how-to-perspective-date-time-input-default-todays-date-fixed-time/53971/3 "2021-12-10T12:33:37Z")

</div>

In an expression:

```auto
setTime(now(),6,0,0)

```

Will return now with the time set to 6:00:00 AM obviously you can replace the hour, minutes, and/or seconds with a property or tag value of your choosing.

In scripting

```auto
system.date.setTime(system.date.now(),6,0,0)

```

---

<div class="post-metadata">

**Author:** ![jeff.ryan](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jeff.ryan/32/25543_2.png) [@jeff.ryan](https://forum.inductiveautomation.com/u/jeff.ryan)\
**Post date:** [December 10, 2021, 2:41pm UTC](https://forum.inductiveautomation.com/t/how-to-perspective-date-time-input-default-todays-date-fixed-time/53971/4 "2021-12-10T14:41:24Z")

</div>

yes,

and the concatonate a fixed time ideally

---

<div class="post-metadata">

**Author:** ![jeff.ryan](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jeff.ryan/32/25543_2.png) [@jeff.ryan](https://forum.inductiveautomation.com/u/jeff.ryan)\
**Post date:** [December 13, 2021, 4:10pm UTC](https://forum.inductiveautomation.com/t/how-to-perspective-date-time-input-default-todays-date-fixed-time/53971/5 "2021-12-13T16:10:57Z")

</div>

Yup, that was it, seems like kind of an obvious one to miss, thanks. One minor kicker, is I need it set that way on startup, but not the value bound to it, but I got that done in the Events, OnStartup script. Thanks again.
