# Perpective Table Date Column is Unformatted in Python

**URL:** <https://forum.inductiveautomation.com/t/perpective-table-date-column-is-unformatted-in-python/72942>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [April 26, 2023, 8:18pm UTC](https://forum.inductiveautomation.com/t/perpective-table-date-column-is-unformatted-in-python/72942 "2023-04-26T20:18:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeff\_Spicuzzi](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@Jeff\_Spicuzzi](https://forum.inductiveautomation.com/u/Jeff_Spicuzzi)\
**Post date:** [April 26, 2023, 8:18pm UTC](https://forum.inductiveautomation.com/t/perpective-table-date-column-is-unformatted-in-python/72942/1 "2023-04-26T20:18:57Z")

</div>

I have a simple line of code to display the formatted date from the selected row in a table. PeriodEnd column is configured with the correct name, Render=date, DateFormat is MM/DD/YYYY HH:mm:ss The date displays properly in the table when I reference it with a script the date is not formatted. Displays as 1682524800000

How do I get the formatted value in script???

self.getSibling("TextField").props.text=self.props.selection.data[0].PeriodEnd

---

<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:** [April 26, 2023, 8:27pm UTC](https://forum.inductiveautomation.com/t/perpective-table-date-column-is-unformatted-in-python/72942/2 "2023-04-26T20:27:31Z")

</div>

Because the underlying data for dates and timestamps is milliseconds UTC (required to format on the browser end, with proper timezone handling). In a script, use `system.date.fromMillis()` to get the true date object. Do not do formatting in scripts--that will screw up timezones if the client and the gateway are different. For databases, pass the date object itself into your named queries or scripted "Prep" queries--again, without string formatting.

---

<div class="post-metadata">

**Author:** ![Jeff\_Spicuzzi](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@Jeff\_Spicuzzi](https://forum.inductiveautomation.com/u/Jeff_Spicuzzi)\
**Post date:** [April 26, 2023, 8:34pm UTC](https://forum.inductiveautomation.com/t/perpective-table-date-column-is-unformatted-in-python/72942/3 "2023-04-26T20:34:15Z")

</div>

Thank you !! Exactly what I needed. Solved.

---

<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:** [April 26, 2023, 8:38pm UTC](https://forum.inductiveautomation.com/t/perpective-table-date-column-is-unformatted-in-python/72942/4 "2023-04-26T20:38:37Z")

</div>

{ Psst! Why did you mark _yourself_ as the source of the solution? }

---

<div class="post-metadata">

**Author:** ![Jeff\_Spicuzzi](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@Jeff\_Spicuzzi](https://forum.inductiveautomation.com/u/Jeff_Spicuzzi)\
**Post date:** [May 30, 2023, 7:17pm UTC](https://forum.inductiveautomation.com/t/perpective-table-date-column-is-unformatted-in-python/72942/5 "2023-05-30T19:17:50Z")

</div>

errant click. corrected
