Updating Current Time Tag

I feel like this is really easy but I can’t quite get it on Ignition 8.0. What I am trying to do is create a memory tag that just updates the current time. I know the System current minute tag is available but I want the value to be on a memory tag so I can create a script on the memory tag. The function I used in 7.9.10 is dateFormat(now(), “h:mm:ss a”) and I scripted that on the expression part of the tag but where would I be able to add an expression on the tag for 8.0 to accomplish the same thing? How can I bind the value of the tag to be the current time/minute that updates every second?

I had some odd behavior when I copy pasted it from the forum, I’m wondering if I grabbed an extra space or something, but the below option should work.

dateFormat(now(100), 'hh:mm:ss a')

image

If your code had curly quotes in it (“”)like the ones in your post, these would prevent it from working. Expressions must use single or double straight quotes (' or ").

1 Like

If you open the Tag Editor for the tag and set the Value Source to Expression (or just create an Expression tag) instead of memory, you can then put dateFormat(now(1000),"h:mm:ss a") where it says Expression.