# How to send date time as a parameter, vision popup

**URL:** <https://forum.inductiveautomation.com/t/how-to-send-date-time-as-a-parameter-vision-popup/95295>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [August 28, 2024, 8:39pm UTC](https://forum.inductiveautomation.com/t/how-to-send-date-time-as-a-parameter-vision-popup/95295 "2024-08-28T20:39:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [August 28, 2024, 8:39pm UTC](https://forum.inductiveautomation.com/t/how-to-send-date-time-as-a-parameter-vision-popup/95295/1 "2024-08-28T20:39:15Z")

</div>

I am thinking of using a date time as a parameter for a popup, but I am not sure how to format it so that I only get the date time, and not all the extras.

I created a custom prop on the popup, eventTS, tried using the DATE type, then tried STRING, but neither works as is.

The line of thinking is I would like to grab the time stamp off a tag when it fires, then use the time stamp to update the associated record in the DB with additional info in the near future of the tag fire event.

Here is the error when using a DATE type custom prop:

```python
ValueError: Error setting parameter: eventTS. Could not convert [[Wed Aug 28 13:17:23 PDT 2024, Good, Wed Aug 28 13:38:29 PDT 2024 (1724877509536)]] into Date.

```

EDIT:  
I have a label bound to the "eventTS" prop, and here is what it looks like when using the STRING data type for the custom prop:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/a/ca5161f849419a1d7edf92b82afdc6139a6da536.png)

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [August 28, 2024, 8:44pm UTC](https://forum.inductiveautomation.com/t/how-to-send-date-time-as-a-parameter-vision-popup/95295/2 "2024-08-28T20:44:09Z")

</div>

The error you are getting when using the DATE type is because you are passing the entire `qualifiedValue` object to the popup parameter.

Qualified values have value, quality, and timestamp members, so to get the timestamp maybe you need to use `.timestamp`, such as `popupParam = currentValue.timestamp` or similar.

---

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [August 29, 2024, 12:49am UTC](https://forum.inductiveautomation.com/t/how-to-send-date-time-as-a-parameter-vision-popup/95295/3 "2024-08-29T00:49:49Z")

</div>

So the tag has a `timestamp` element. `[Sample_Tags]Writeable/WriteableBoolean2.Timestamp`  
The value of this element should only be the `timestamp`, and you cannot add a `.value` or `.timestamp` to the end of it.

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [August 29, 2024, 1:07am UTC](https://forum.inductiveautomation.com/t/how-to-send-date-time-as-a-parameter-vision-popup/95295/4 "2024-08-29T01:07:33Z")

</div>

How are you sourcing this timestamp value? Are you calling `system.tag.read*`? Are you using a valueChange event and using `currentValue.timestamp` or `currentValue.value`?

If you are fetching the tag value via any `system.tag.read*` call it will return a **list** of qualifiedValue objects.

> **[system.tag.readBlocking | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-tag/system-tag-readBlocking#returns)**
>
> Reads the value of the tags at the given paths.

This means you will need to pull the object from the list and then either use `.value` or `.timestamp` to pull the preferred data. (i.e. `popupParam = tagValues[0].timestamp`)

`currentValue` is also a qualifiedValue, if you are using a change event script. That should allow you to just use `currentValue.value` or `currentValue.timestamp`

> [@mdemaris](#):
>
> `[[Wed Aug 28 13:17:23 PDT 2024, Good, Wed Aug 28 13:38:29 PDT 2024 (1724877509536)]]`

This would seem to indicate you are using a `system.tag.read*` call, as the data appears to be a `qualifiedValue` in a list.

Edit:  
Quick script confirming my suspicion:

```python
tagPath = "[Provider]Global/TestTypeID.Timestamp"
tagValues = system.tag.readBlocking([tagPath])
print tagValues
print tagValues[0]
print tagValues[0].value

```

Nets the following in the console:

```python
>>> 
[[Mon Aug 26 17:14:18 EDT 2024, Good, Wed Aug 28 21:17:11 EDT 2024 (1724894231151)]]
[Mon Aug 26 17:14:18 EDT 2024, Good, Wed Aug 28 21:17:11 EDT 2024 (1724894231151)]
Mon Aug 26 17:14:18 EDT 2024
>>> 

```

Note how the first console line matches the data format shown in your error message. Use `eventTS = tagValues[0].value` to assign the actual date object to the parameter.

---

<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:** [August 29, 2024, 10:06am UTC](https://forum.inductiveautomation.com/t/how-to-send-date-time-as-a-parameter-vision-popup/95295/5 "2024-08-29T10:06:58Z")

</div>

You can read the tag itself, then extract the `timestamp` from the qualified value:

```python
system.tag.readBlocking([your_tag])[0].timestamp
==
system.tag.readBlocking([your_tag.timestamp])[0].value

```

---

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [August 29, 2024, 4:22pm UTC](https://forum.inductiveautomation.com/t/how-to-send-date-time-as-a-parameter-vision-popup/95295/6 "2024-08-29T16:22:27Z")

</div>

> [@ryan.white](#):
>
> it will return a **list**

Um, yep, missed the list part. Thanks!
