# system.date.setTime() Question

**URL:** <https://forum.inductiveautomation.com/t/system-date-settime-question/11357>\
**Category:** Ignition\
**Created:** [March 14, 2016, 12:48am UTC](https://forum.inductiveautomation.com/t/system-date-settime-question/11357 "2016-03-14T00:48:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![WillMT10](https://avatars.discourse-cdn.com/v4/letter/w/7feea3/32.png) [@WillMT10](https://forum.inductiveautomation.com/u/WillMT10)\
**Post date:** [March 14, 2016, 12:48am UTC](https://forum.inductiveautomation.com/t/system-date-settime-question/11357/1 "2016-03-14T00:48:43Z")

</div>

I’ve finally gotten around to delving in the “new” system.date scripting functions and I’ve been having a problem with the .setTime() function. For the hour variable, when I enter an integer less than 12 it will set the time in the resulting date to an hour greater than 12. For example when I use the following function it returns the Date “Sun Mar 13 21:30:00 EDT 2016” but I was expecting it to return “Sun Mar 13 09:30:00 EDT 2016”:`system.date.setTime(system.date.getDate(2016, 2, 13), 9, 30, 0)`Also, in order to get a Date of “Sun Mar 13 09:30:00 EDT 2016” I have to decrement the day by 1 AND set the hour variable to 21:`system.date.setTime(system.date.getDate(2016, 2, 12), 21, 30, 0)`Based on the functions description it seems like this may be a bug but if it is something I am doing wrong, please let me know.

Thanks,  
-Will

Specs:  
Ignition Platform v7.8.1  
Ignition Server: Windows 7 PC, 8C, 2.4 GHz, 32GB RAM  
Ignition Designer/Client Running On: Mac OSX 10.11.3, 4C, 2.7 GHz, 16GB RAM

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 14, 2016, 3:43pm UTC](https://forum.inductiveautomation.com/t/system-date-settime-question/11357/2 "2016-03-14T15:43:15Z")

</div>

This is a bug. It’s fixed already and will land in the 7.8.3 release.

---

<div class="post-metadata">

**Author:** ![WillMT10](https://avatars.discourse-cdn.com/v4/letter/w/7feea3/32.png) [@WillMT10](https://forum.inductiveautomation.com/u/WillMT10)\
**Post date:** [March 14, 2016, 6:06pm UTC](https://forum.inductiveautomation.com/t/system-date-settime-question/11357/3 "2016-03-14T18:06:54Z")

</div>

Perfect! Thanks Kevin!
