# Gateway Tag Change Script "event.getCurrentValue().timestamp"

**URL:** <https://forum.inductiveautomation.com/t/gateway-tag-change-script-event-getcurrentvalue-timestamp/100806>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [January 13, 2025, 4:42pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-change-script-event-getcurrentvalue-timestamp/100806 "2025-01-13T16:42:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Imran\_Husain](https://avatars.discourse-cdn.com/v4/letter/i/54ee81/32.png) [@Imran\_Husain](https://forum.inductiveautomation.com/u/Imran_Husain)\
**Post date:** [January 13, 2025, 4:42pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-change-script-event-getcurrentvalue-timestamp/100806/1 "2025-01-13T16:42:07Z")

</div>

Hello,

I have a gateway tag change script that has the following code:

```python
tag_path = event.tagPath.getParentPath()
data_value = event.getCurrentValue().value
timestamp = event.getCurrentValue().timestamp
tag_path_str = str(tag_path)
tag_full_name_str = str(event.tagPath)

```

I want to know what the format of the timestamp is. I understand the getCurrentValue returns a 'Qualified Value' which includes the value, quality and timestamp of the value. I am sending the payload file to Azure. When I get it in Azure the file name of the .json is a string of identifiers and the date and time appended at the end. I am looking to change the format of the date/time in the file name but do not know if this is possible using Ignition.

Any help is appreciated.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [January 13, 2025, 4:47pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-change-script-event-getcurrentvalue-timestamp/100806/2 "2025-01-13T16:47:40Z")

</div>

`event.getCurrentValue().timestamp` will return the timestamp in Ignition's millisecond format (number of ms since 1970-01-01 00:00:00). _(See Phil's finer detail below.)_ Most of the components will recognise that it's a date and automatically convert it into the format `Mon Jan 13 16:44:01 GMT 2025`. Many components provide a dateFormat option to change this.

In a script you can format it any way you like using [system.date.format | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-date/system-date-format). See the [Data Type Formatting Reference | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/reference-pages/data-type-formatting-reference) for details.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 13, 2025, 4:49pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-change-script-event-getcurrentvalue-timestamp/100806/3 "2025-01-13T16:49:39Z")

</div>

> [@Transistor](#):
>
> `.timestamp` will return the timestamp in Ignition's millisecond format

No, it is an actual instance of `java.util.Date`, which is milliseconds UTC under the hood.
