# System Time As MODBUS Register values

**URL:** <https://forum.inductiveautomation.com/t/system-time-as-modbus-register-values/85890>\
**Category:** Ignition\
**Created:** [February 17, 2024, 8:39pm UTC](https://forum.inductiveautomation.com/t/system-time-as-modbus-register-values/85890 "2024-02-17T20:39:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pridesleap](https://avatars.discourse-cdn.com/v4/letter/p/f4b2a3/32.png) [@pridesleap](https://forum.inductiveautomation.com/u/pridesleap)\
**Post date:** [February 17, 2024, 8:39pm UTC](https://forum.inductiveautomation.com/t/system-time-as-modbus-register-values/85890/1 "2024-02-17T20:39:28Z")

</div>

I need to send time synch values from SCADA to a modbus device. The device is looking for SECOND, MINUTE, HOUR, DAY, MONTH, YEAR to be sent from SCADA on six (6) seperate registers (one register for each element). I believe the Gateway server system time/date value will suffice. What is the best way toparse the server system time/date into the individual elements required?

---

<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:** [February 17, 2024, 8:43pm UTC](https://forum.inductiveautomation.com/t/system-time-as-modbus-register-values/85890/2 "2024-02-17T20:43:59Z")

</div>

You could probably pull each piece out with the `system.date.get*` functions.

> **[system.date.get\* | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-date/system-date-get)**
>
> Extracts a unit of time from a date.

---

<div class="post-metadata">

**Author:** ![pridesleap](https://avatars.discourse-cdn.com/v4/letter/p/f4b2a3/32.png) [@pridesleap](https://forum.inductiveautomation.com/u/pridesleap)\
**Post date:** [February 17, 2024, 9:57pm UTC](https://forum.inductiveautomation.com/t/system-time-as-modbus-register-values/85890/3 "2024-02-17T21:57:32Z")

</div>

This will probably be the way. Thanks Kevin.

---

<div class="post-metadata">

**Author:** ![pridesleap](https://avatars.discourse-cdn.com/v4/letter/p/f4b2a3/32.png) [@pridesleap](https://forum.inductiveautomation.com/u/pridesleap)\
**Post date:** [February 18, 2024, 1:52am UTC](https://forum.inductiveautomation.com/t/system-time-as-modbus-register-values/85890/4 "2024-02-18T01:52:46Z")

</div>

Update:  
I discovered that there are Expression Functions for get\* which work really well for my purposes.

However, getMonth(now()) returns a value of "1" and not "2" as you would expect for February. Does this function reference from month "0" for January?

EDIT:

You answered this on before for someone else.

Found it in the manual:  
[https://www.docs.inductiveautomation.com/docs/8.1/appendix/expression-functions/date-and-time/get](https://www.docs.inductiveautomation.com/docs/8.1/appendix/expression-functions/date-and-time/get)

"Extracts the month from a date, where January is month 0."

---

<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:** [February 18, 2024, 2:14am UTC](https://forum.inductiveautomation.com/t/system-time-as-modbus-register-values/85890/5 "2024-02-18T02:14:28Z")

</div>

> [@pridesleap](#):
>
> Does this function reference from month "0" for January?

> Extracts the month from a date, where January is month 0.

> **[get\* | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/expression-functions/date-and-time/get)**
>
> Extracts a unit of time from a date

---

<div class="post-metadata">

**Author:** ![pridesleap](https://avatars.discourse-cdn.com/v4/letter/p/f4b2a3/32.png) [@pridesleap](https://forum.inductiveautomation.com/u/pridesleap)\
**Post date:** [February 18, 2024, 2:16am UTC](https://forum.inductiveautomation.com/t/system-time-as-modbus-register-values/85890/6 "2024-02-18T02:16:52Z")

</div>

yeah, I was editing my post when you responded. I found where you previously answered this and I should have just read more closely.

---

<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:** [February 18, 2024, 2:17am UTC](https://forum.inductiveautomation.com/t/system-time-as-modbus-register-values/85890/7 "2024-02-18T02:17:14Z")

</div>

It's okay, just a chance for me to add more links to the new manual 🙂
