# Dataset Add Column Date Type

**URL:** <https://forum.inductiveautomation.com/t/dataset-add-column-date-type/111712>\
**Category:** Ignition\
**Tags:** ignition81, vision, scripting\
**Created:** [October 24, 2025, 8:11pm UTC](https://forum.inductiveautomation.com/t/dataset-add-column-date-type/111712 "2025-10-24T20:11:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [October 24, 2025, 8:11pm UTC](https://forum.inductiveautomation.com/t/dataset-add-column-date-type/111712/1 "2025-10-24T20:11:27Z")

</div>

How do I use system.dataset.addColumn() to add a date formatted column to the dataset? I’ve tried

```python
data2 = system.dataset.addColumn(data, colCount, newColumn, 'Date', Date)
data2 = system.dataset.addColumn(data, colCount, newColumn, 'Date', java.util.Date)
data2 = system.dataset.addColumn(data, colCount, newColumn, 'Date', 'java.util.Date')
data2 = system.dataset.addColumn(data, colCount, newColumn, 'Date', 'Date')

```

They all throw errors

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 24, 2025, 8:35pm UTC](https://forum.inductiveautomation.com/t/dataset-add-column-date-type/111712/2 "2025-10-24T20:35:11Z")

</div>

> [@amarks](#):
>
> `data2 = system.dataset.addColumn(data, colCount, newColumn, 'Date', java.util.Date)`

It should be this, or

```python
from java.util import Date
data2 = system.dataset.addColumn(data, colCount, newColumn, 'Date', Date)

```

Or I think this would also work:

```python
d = system.date.now()
data2 = system.dataset.addColumn(data, colCount, newColumn, 'Date', type(d))

```

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [October 24, 2025, 9:11pm UTC](https://forum.inductiveautomation.com/t/dataset-add-column-date-type/111712/3 "2025-10-24T21:11:48Z")

</div>

I was able to get it to work with

```python
data2 = system.dataset.addColumn(data, colCount, newColumn, 'Date', str)

```

---

<div class="post-metadata">

**Author:** ![drojas](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drojas/32/3403_2.png) [@drojas](https://forum.inductiveautomation.com/u/drojas)\
**Post date:** [October 24, 2025, 9:34pm UTC](https://forum.inductiveautomation.com/t/dataset-add-column-date-type/111712/4 "2025-10-24T21:34:10Z")

</div>

That looks like just an empty string column being added with the name “Date”. Maybe the data you were trying to add wasn’t an actual date object?

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [October 25, 2025, 6:13pm UTC](https://forum.inductiveautomation.com/t/dataset-add-column-date-type/111712/5 "2025-10-25T18:13:14Z")

</div>

The `newColumn` list entries were made with `system.date.format()`. The list is not empty, but you’re probably correct that they’re not the Date datatype, but I was still getting errors that had nothing to do with type mismatch. The issue was likely that I didn’t import the java type Date

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 27, 2025, 4:21pm UTC](https://forum.inductiveautomation.com/t/dataset-add-column-date-type/111712/6 "2025-10-27T16:21:34Z")

</div>

`system.date.format` turns date objects into strings (a lossy operation that should only be done at the last possible moment before presentation), so it makes sense you were getting type coercion errors trying to put a string into a date-typed column.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [October 27, 2025, 4:42pm UTC](https://forum.inductiveautomation.com/t/dataset-add-column-date-type/111712/7 "2025-10-27T16:42:45Z")

</div>

Had I imported the type, ya I probably would have gotten those errors but I didn’t actually make it that far because I didn’t import the type 😅
