Hello everyone
I am trying to write a simple script that will add a certain amount of minutes to a time stamp. This is intended to show what time a part will be completed, by adding its average cycle time to the time stamp of when the cycle started. I figured an addMinutes function would be a slick way to do this.
When I write my code, it gives an output with accurate time, but the date is askew. Here is my code:
dateFormat(addMinutes(toDate({[.]T_Stamp-Start}), {[.]PalletCycleTime}), “MM-dd-yyyy HH:mm:ss”)
[.]T_Stamp-Start is a string formatted tag which is the timestamp of when the cycle starts, configured in the “MM-dd-yyyy HH:mm:ss” format
[.]PalletCycleTime is an int formatted memory tag @ the moment, but will become an SQL query when the logic behaves. its created as an INT as that is what addMinutes() called out.
the scripting works (or at least does not create an null) and the time is spot on. The output date always shows up as 09-09-0014.
For example:
- T_Stamp-Start = 08-15-2019 9:15:33
- PalletCycleTime = 11
- output of script: 09-09-0014 9:26:33
ive tried all kinds of formatting, eventChange scripting vs expression tags, all with no luck. Any Ideas? Any more information needed?
thanks!