# Convert Date into UTC format in perspective

**URL:** <https://forum.inductiveautomation.com/t/convert-date-into-utc-format-in-perspective/57818>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 30, 2022, 2:40pm UTC](https://forum.inductiveautomation.com/t/convert-date-into-utc-format-in-perspective/57818 "2022-03-30T14:40:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pooja\_g](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@pooja\_g](https://forum.inductiveautomation.com/u/pooja_g)\
**Post date:** [March 30, 2022, 2:40pm UTC](https://forum.inductiveautomation.com/t/convert-date-into-utc-format-in-perspective/57818/1 "2022-03-30T14:40:59Z")

</div>

I want to convert date to UTC Format(2022-03-30T19:43:30.00Z) after selection of a date in dateTimeInput component in perspective. How can this be achieved..

---

<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:** [March 30, 2022, 2:43pm UTC](https://forum.inductiveautomation.com/t/convert-date-into-utc-format-in-perspective/57818/2 "2022-03-30T14:43:05Z")

</div>

There are date formatting [expressions](https://docs.inductiveautomation.com/display/DOC81/dateFormat) and [scripting functions](https://docs.inductiveautomation.com/display/DOC81/system.date.format). What are you trying to do with the UTC formatted date?

---

<div class="post-metadata">

**Author:** ![Craig\_webber](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/craig_webber/32/62546_2.png) [@Craig\_webber](https://forum.inductiveautomation.com/u/Craig_webber)\
**Post date:** [January 14, 2025, 8:19pm UTC](https://forum.inductiveautomation.com/t/convert-date-into-utc-format-in-perspective/57818/3 "2025-01-14T20:19:27Z")

</div>

@Kevin.Herron

I am using a standard tag query and then converrting it to a csv  
dataset = system.tag.queryTagHistory()  
csv = system.dataset.toCSV(dataset = dataset , showHeaders = True, forExport = False)

How can I format the timestamps to use UTC, the toCSV saves them as local timezone.

Thanks in advanced

---

<div class="post-metadata">

**Author:** ![deon.korb](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@deon.korb](https://forum.inductiveautomation.com/u/deon.korb)\
**Post date:** [May 21, 2025, 9:01am UTC](https://forum.inductiveautomation.com/t/convert-date-into-utc-format-in-perspective/57818/4 "2025-05-21T09:01:27Z")

</div>

I know this is very old, but if anyone else stumbles across this:

`system.date.now().toInstant().toString()`

This works on any `java.util.Date`
