# Time/date transform in perspective table

**URL:** <https://forum.inductiveautomation.com/t/time-date-transform-in-perspective-table/88559>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [April 9, 2024, 6:31am UTC](https://forum.inductiveautomation.com/t/time-date-transform-in-perspective-table/88559 "2024-04-09T06:31:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrd](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jrd](https://forum.inductiveautomation.com/u/jrd)\
**Post date:** [April 9, 2024, 6:31am UTC](https://forum.inductiveautomation.com/t/time-date-transform-in-perspective-table/88559/1 "2024-04-09T06:31:32Z")

</div>

Hi  
Using perspective, I would like to display the 'scheduled events' data from an equipment schedule component in a table. I copied the binding, and all is fine....  
except the format of the startDate and endDate fields. These come back as longs in milliseconds. I would like to convert them to date/time strings in the table.  
So I use the following transform:

```auto
def transform(self, value, quality, timestamp):
								
	for row in value:
		system.perspective.print(row)
		new_start = row['startDate']
		new_end = row['endDate']		
		new_values = {'startDate':new_start, 'endDate':new_end}
		
		row.update(new_values)
		system.perspective.print(row)

	return value

```

But I get an error "..... common.script.ada' object has no attribute update" referring to the row.update() line  
It seems to me that the return value (Json) is a list of dictionaries, thus 'row' (dictionary) should have an update method.

What have I missed?  
How would I achieve my objective?

Thanks in advance.

---

<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:** [April 9, 2024, 7:36am UTC](https://forum.inductiveautomation.com/t/time-date-transform-in-perspective-table/88559/2 "2024-04-09T07:36:44Z")

</div>

> [@jrd](#):
>
> I would like to convert them to date/time strings in the table.

That's generally a bad idea. Keep them as datetime type and just have them displayed in the format you want.

For Perspective's Table component you need to set each  
`columm.x.field : <columnName>`  
and then you can specifiy  
`column.x.render : date`  
which will use  
`column.x.dateFormat`

Many of the column properties don't take effect if the `field` property is not set to the column name.

---

<div class="post-metadata">

**Author:** ![jrd](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jrd](https://forum.inductiveautomation.com/u/jrd)\
**Post date:** [April 9, 2024, 11:03am UTC](https://forum.inductiveautomation.com/t/time-date-transform-in-perspective-table/88559/3 "2024-04-09T11:03:38Z")

</div>

Thanks Transistor,  
you are are a genius  
works a charm!  
I searched all the options before posting, except that one!

Thanks champ!

---

<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:** [April 9, 2024, 11:08am UTC](https://forum.inductiveautomation.com/t/time-date-transform-in-perspective-table/88559/4 "2024-04-09T11:08:41Z")

</div>

Ahem! [Cough, cough!] You've marked your post as the solution. Shouldn't you have marked mine?

---

<div class="post-metadata">

**Author:** ![jrd](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jrd](https://forum.inductiveautomation.com/u/jrd)\
**Post date:** [April 10, 2024, 3:44am UTC](https://forum.inductiveautomation.com/t/time-date-transform-in-perspective-table/88559/5 "2024-04-10T03:44:14Z")

</div>

fixed
