# Power table column datatype change string to date

**URL:** <https://forum.inductiveautomation.com/t/power-table-column-datatype-change-string-to-date/44743>\
**Category:** Ignition\
**Created:** [March 22, 2021, 7:31am UTC](https://forum.inductiveautomation.com/t/power-table-column-datatype-change-string-to-date/44743 "2021-03-22T07:31:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neha.kabra](https://avatars.discourse-cdn.com/v4/letter/n/e36b37/32.png) [@Neha.kabra](https://forum.inductiveautomation.com/u/Neha.kabra)\
**Post date:** [March 22, 2021, 7:31am UTC](https://forum.inductiveautomation.com/t/power-table-column-datatype-change-string-to-date/44743/1 "2021-03-22T07:31:22Z")

</div>

how to change power table datatype string to date by using power table script functions, while data binded to custom property. That data loaded from open window to that custom property with proper data headers & data include in that.

so kindly help to change datatype of power table string to date using any scripts.  
That date datatype of column only allow me to open date picker for that cell.

---

<div class="post-metadata">

**Author:** ![vasanth.p](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/vasanth.p/32/38099_2.png) [@vasanth.p](https://forum.inductiveautomation.com/u/vasanth.p)\
**Post date:** [March 22, 2021, 11:22am UTC](https://forum.inductiveautomation.com/t/power-table-column-datatype-change-string-to-date/44743/2 "2021-03-22T11:22:28Z")

</div>

If you are intending to change the datatype of the specific column alone

> [@Illegal type for X value: class java.lang.String (column 'Date')](http://forum.inductiveautomation.com/t/illegal-type-for-x-value-class-java-lang-string-column-date/20124/2):
>
> You could use this code in a propertyChange script to convert your string to a date: from java.text import SimpleDateFormat # set the format of the date string format = SimpleDateFormat("MM/dd/yyyy") # get the raw data ds = event.source.parent.RawData # This is your memory tag in a CustomProperty ds2 = system.dataset.toPyDataSet(ds) newRows = [] if len(ds2) \> 0: # convert each row for row in ds2: dateStamp = format.parse(row[0]) newRows.append([dateStamp, row[1]]) # create the n…

Can help I guess..

---

<div class="post-metadata">

**Author:** ![Neha.kabra](https://avatars.discourse-cdn.com/v4/letter/n/e36b37/32.png) [@Neha.kabra](https://forum.inductiveautomation.com/u/Neha.kabra)\
**Post date:** [March 23, 2021, 4:35am UTC](https://forum.inductiveautomation.com/t/power-table-column-datatype-change-string-to-date/44743/3 "2021-03-23T04:35:33Z")

</div>

This is Helpful. Thanks  
Bt i got error for this code in power table property change is:

Traceback (most recent call last):  
File “event:propertyChange”, line 16, in   
java.text.ParseException: java.text.ParseException: Unparseable date: “1080422913”

```
caused by ParseException: Unparseable date: "1080422913"

```

Is anyone help me on this?  
Thanks

---

<div class="post-metadata">

**Author:** ![vasanth.p](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/vasanth.p/32/38099_2.png) [@vasanth.p](https://forum.inductiveautomation.com/u/vasanth.p)\
**Post date:** [March 23, 2021, 5:46am UTC](https://forum.inductiveautomation.com/t/power-table-column-datatype-change-string-to-date/44743/4 "2021-03-23T05:46:22Z")

</div>

Post the complete code that you tried and screenshots of what you are solving. This can help people to understand your problem better.

From what I understand, the string is Epoch Timestamp.

Epoch - “8-byte integer representing the number of milliseconds elapsed since January 1, 1970”.

But provided in seconds(assuming by the number of digits), So multiplied by 1000 can give you the Epoch in milliseconds.

[https://docs.inductiveautomation.com/display/DOC80/system.date.fromMillis](https://docs.inductiveautomation.com/display/DOC80/system.date.fromMillis)

Can help you convert this to a date object.

---

<div class="post-metadata">

**Author:** ![Neha.kabra](https://avatars.discourse-cdn.com/v4/letter/n/e36b37/32.png) [@Neha.kabra](https://forum.inductiveautomation.com/u/Neha.kabra)\
**Post date:** [March 23, 2021, 11:59am UTC](https://forum.inductiveautomation.com/t/power-table-column-datatype-change-string-to-date/44743/5 "2021-03-23T11:59:23Z")

</div>

ok. I have attached screenshot of code which i used on power table to get date picker for one column.

still i got this error & not able to save date, choose date from date picker which is popup at power table column.

 ![Codeonpowertable](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/9/e9287a9844bf1cda89114ef3c276c8004da92913.png)

Error:  
Exception in thread “AWT-EventQueue-0” NotImplementedError: ‘MyCellEditor’ object does not implement abstract method ‘getCellEditorValue’ from ‘javax.swing.CellEditor’

please help to solve above mentioned error, that will help to choose & save date for that cell with particular column binded to date picker.  
Thanks.
