# OPC Tag Timestamp to Milliseconds?

**URL:** <https://forum.inductiveautomation.com/t/opc-tag-timestamp-to-milliseconds/73486>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [May 9, 2023, 4:33pm UTC](https://forum.inductiveautomation.com/t/opc-tag-timestamp-to-milliseconds/73486 "2023-05-09T16:33:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carlos\_Gibson](https://avatars.discourse-cdn.com/v4/letter/c/45deac/32.png) [@Carlos\_Gibson](https://forum.inductiveautomation.com/u/Carlos_Gibson)\
**Post date:** [May 9, 2023, 4:33pm UTC](https://forum.inductiveautomation.com/t/opc-tag-timestamp-to-milliseconds/73486/1 "2023-05-09T16:33:51Z")

</div>

Hello, we have some boolean OPC UA tags and we want to get the alarm timestamps configured on these tags down the the millisecond. This is possible in our legacy SCADA (PSO) systems, but I'm not sure where that configuration would exist. These are MMS points with value, timestamp, and quality being reported.

---

<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:** [May 9, 2023, 4:36pm UTC](https://forum.inductiveautomation.com/t/opc-tag-timestamp-to-milliseconds/73486/2 "2023-05-09T16:36:51Z")

</div>

Timestamps do include milliseconds, but you may be viewing them somewhere that they are formatted without them.

Give us some more context about what you're doing and where you're viewing these timestamps.

---

<div class="post-metadata">

**Author:** ![Carlos\_Gibson](https://avatars.discourse-cdn.com/v4/letter/c/45deac/32.png) [@Carlos\_Gibson](https://forum.inductiveautomation.com/u/Carlos_Gibson)\
**Post date:** [May 9, 2023, 4:42pm UTC](https://forum.inductiveautomation.com/t/opc-tag-timestamp-to-milliseconds/73486/3 "2023-05-09T16:42:06Z")

</div>

I'm viewing the tag Timestamp directly in the tag browser. Would they get formatted there as well?

---

<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:** [May 9, 2023, 4:46pm UTC](https://forum.inductiveautomation.com/t/opc-tag-timestamp-to-milliseconds/73486/4 "2023-05-09T16:46:04Z")

</div>

Yeah, the Tag Browser just uses the default Java date format, which is something like `EEE MMM dd HH:mm:ss zzz yyyy` in terms of format strings. It does not include millis.

The millisecond data is there under the hood when needed, though.

---

<div class="post-metadata">

**Author:** ![Carlos\_Gibson](https://avatars.discourse-cdn.com/v4/letter/c/45deac/32.png) [@Carlos\_Gibson](https://forum.inductiveautomation.com/u/Carlos_Gibson)\
**Post date:** [May 9, 2023, 4:47pm UTC](https://forum.inductiveautomation.com/t/opc-tag-timestamp-to-milliseconds/73486/5 "2023-05-09T16:47:40Z")

</div>

Got it! I see, I was able to reveal the granularity under the hood. Thank you Kevin!

```auto
tag = system.tag.readBlocking('[TagProvider]HeartbeatInstance/Heartbeat.Timestamp')
timestamp = tag[0].value
timestamp = system.date.format(timestamp, "yyy-MM-dd HH:mm:ss:SSS")

print(timestamp)

```

```auto
>>> 
2023-05-09 16:46:14:850

```

---

<div class="post-metadata">

**Author:** ![JoshC](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/joshc/32/66169_2.png) [@JoshC](https://forum.inductiveautomation.com/u/JoshC)\
**Post date:** [October 11, 2024, 11:37pm UTC](https://forum.inductiveautomation.com/t/opc-tag-timestamp-to-milliseconds/73486/6 "2024-10-11T23:37:34Z")

</div>

You can also get greater granularity revealed directly on the tag value by adjusting the 'Format String' field in the tag properties to include the desired Date Type Formatting:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/9/897a3c5ad2106482473597c625f850228574aa08.png)

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/d/3d0092c1d97b42cfbc5f8fe390c2bdf88148f24e.png)
