Displaying time & date in groov View from an Int32 table

(using the latest EPIC Firmware 1.5.0 and groov View 4.2a)

I am using NTP Timestamps in my PAC Control strategy so that I can easily perform time computations. However, for the HMI (groov View) that everyday people see, I need to display it in human readable form, e.g. 12-29-2019 22:59.

I am using the function NtpTimestampToDateTime which places the date & time in an integer 32 table. Below is what the table looks like in PAC Control:
ntDateTime

All good there, but is there an easy way to get that date & time to appear in groov View? I have duplicated the Value gadget 5 times (Month, Day, Year, HourOfDay, Minute) and lined them up, but I am wondering if there is a better way to do this?
inGroovViewBuild


inGroovView

Hi Grant, I usually build a string in my pac project from the integer values. Then I simply display the time string in groov view.

1 Like

That sounds like a good approach. I quickly searched the forums and user guide for building a string from an Int32 table, but could not find anything. Can you give me a start on how to build a string from an Int32 table?

Another way to display the time in groov is to use the ‘System’ device, this is what I do on all my groov projects to include the time in the top corner of each page.
Using the system time, you can pick your format and use a simple Text area gadget and a single #.

image

Hi Grant, Beno has a good suggestion if your groov and the controller are on the same time. I use many controllers in different time zones on one groov, that is why I do it in the controller. In this example I set up string variables to hold the converted integer values in and then concatenate them together:

Happy to report it all works great now. Only hiccup was that my hours and minutes did not include the leading zero (when appropriate), so in the example below, it displayed 2:9 on 12-31-2019, but thanks to Terry’s code example, I got it to display as 02:09.
CorrectDateTime
And thanks Ben for the tip. I did not realize one could add the “System” device and make that info display.
TimeDateinCorner
Happy New Year!

2 Likes