# Get the timestamp to a tag

**URL:** <https://forum.inductiveautomation.com/t/get-the-timestamp-to-a-tag/107387>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [June 15, 2025, 1:55pm UTC](https://forum.inductiveautomation.com/t/get-the-timestamp-to-a-tag/107387 "2025-06-15T13:55:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anant\_Upadhyayula](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Anant\_Upadhyayula](https://forum.inductiveautomation.com/u/Anant_Upadhyayula)\
**Post date:** [June 15, 2025, 1:55pm UTC](https://forum.inductiveautomation.com/t/get-the-timestamp-to-a-tag/107387/1 "2025-06-15T13:55:18Z")

</div>

I wanted the operator to select a toggle switch "`StartBreak`", I was wondering if there is a way to capture the timestamp value of toggle switch into a tag called `StartTime`.  
`[default]/UserInputs/TimeValues/Break1/StartTime`

I tried tag(`[default]/UserInputs/TimeValues/Break1/StartTime.Timestamp`) but that did not work. Is it possible without scripting ?

---

<div class="post-metadata">

**Author:** ![Anant\_Upadhyayula](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Anant\_Upadhyayula](https://forum.inductiveautomation.com/u/Anant_Upadhyayula)\
**Post date:** [June 15, 2025, 2:02pm UTC](https://forum.inductiveautomation.com/t/get-the-timestamp-to-a-tag/107387/2 "2025-06-15T14:02:49Z")

</div>

no worries, figured it out `timestampOf(tag("[default]Sensor 1/Reading"))`

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [June 15, 2025, 2:16pm UTC](https://forum.inductiveautomation.com/t/get-the-timestamp-to-a-tag/107387/3 "2025-06-15T14:16:09Z")

</div>

> [@Anant\_Upadhyayula](#):
>
> [default]/UserInputs/TimeValues/Break1/StartTime

There shouldn't be a `/` after the provider:  
`[default]UserInputs/TimeValues/Break1/StartTime`

Note that I have no idea what you're storing there exactly, but user input shouldn't be stored in tags. They're gateway scoped and you'll end up with conflicts if more than one user is entering inputs.

---

<div class="post-metadata">

**Author:** ![Anant\_Upadhyayula](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Anant\_Upadhyayula](https://forum.inductiveautomation.com/u/Anant_Upadhyayula)\
**Post date:** [June 15, 2025, 2:20pm UTC](https://forum.inductiveautomation.com/t/get-the-timestamp-to-a-tag/107387/4 "2025-06-15T14:20:59Z")

</div>

I agree,` /` after `[default]` was copy paste error.  
I build a screen where an operator toggles breakstart toggle switch. After that he would have to select the break start time and enter the duration, most of the time the duration is fixed but the operator wanted me to give him the flexibility.  
Then he has to enter the start time and duration. So I added a toggle switch which captures the timestamp of when the toggle switch was pressed. I added toggle switch because later on it will be replaced with a scan code. So the operator would want to scan the barcode and I can feed the duration through the scan and capture the start time as well  
After that the duration count down starts and turn off.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 16, 2025, 3:50pm UTC](https://forum.inductiveautomation.com/t/get-the-timestamp-to-a-tag/107387/5 "2025-06-16T15:50:33Z")

</div>

> [@Anant\_Upadhyayula](#):
>
> timestampOf(tag("[default]Sensor 1/Reading"))

NB there's no need for the `tag` function if you have a single literal string tag path.

```python
timestampOf({[default]Sensor 1/Reading})

```

Will achieve the exact same result, but faster.

---

<div class="post-metadata">

**Author:** ![vtran](https://avatars.discourse-cdn.com/v4/letter/v/779978/32.png) [@vtran](https://forum.inductiveautomation.com/u/vtran)\
**Post date:** [June 16, 2025, 5:46pm UTC](https://forum.inductiveautomation.com/t/get-the-timestamp-to-a-tag/107387/6 "2025-06-16T17:46:40Z")

</div>

I don't think you need the quotes `"` inside the curly braces, unless that's a new thing, which would be nice to be able to build the tag path there (v8.3? 👀)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 16, 2025, 6:16pm UTC](https://forum.inductiveautomation.com/t/get-the-timestamp-to-a-tag/107387/7 "2025-06-16T18:16:38Z")

</div>

No, the quotes were just a typo. No special functionality is added here in 8.3.
