I have two issues, and they appeared to recently come up, where in the past, they have worked. I don't know if these are known issues or if this was fixed in a past nightly build. If they have been fixed, I will work with my team that handles upgrades. I have recently upgraded to 8.1.25 about a month ago.
Issue 1: I fixed some items in my project that are daylight savings sensitive. In the past, this required some manual intervention in November and March however, I recently automated this process through some minor scripting. The system.date.isDaylightTime() works all day, every day. The expression dateIsDaylight() is not working. For every scenario except one, I was able to easily use the system.date.isDaylightTime() function. There is still one case where the expression would simplify things.
Issue 2: I have also noticed the same issue with the function system.tag.browse(), specifically when using the "tagType" for filtering. In the past, I was using this function to scan folders and copy them across tag providers based on scope. I have moved from this function to the system.tag.copy function for the copy requirements, however, I still have a need to use the system.tag.browse() function.
Again I don't know if these were fixed in a revision or nightly build, addressed already, or something of that nature.
For issue #1 I'm really confused, since under the hood the expression simply calls the script function, so they should behave exactly alike, and they call Java's TimeZone class. There's not a lot we're doing here other than making some convenience methods so you don't have to import the Java class.
I was confused as to why that was happening since it was working before. I ran the code you have in your documentation: dateIsDaylight - Ignition User Manual 8.1 - Ignition Documentation, just to confirm the issue.
Here you can see here I copied the code straight out of the doc:
Here is where it should just pull the time at this moment, which should return a True.
And here is where I wrote the command via the script console and it worked using system.time.isDaylightTime():
The script console is running on a local JVM, and is inheriting the timezone from your local machine.
Your expression test is running on the Gateway, which is its own environment and could be reporting a timezone that doesn't adhere to DST, and thus is always false. How are you running the gateway - containerized, in a VM, on bare metal? What OS is it running on? Have your or anyone else ever made changes to
ignition.conf to adjust the timezone the JVM is running in?
That would explain it. I am running Ignition with the EAM module on a VM using Ubuntu 18 in Azure. This is also the machine I am doing the reports at. The reports come from a MySQL database that each node connects to in the cloud. I just checked the timezone and it's UTC.
The node I am reading from and my local machine are both CST. Looks like my first plan of action is to change all the nodes to UTC, regardless of time zone location, to bring some uniformity. I can figure things out from there. Thanks for the help.