# Handling of date columns

**URL:** <https://forum.knime.com/t/handling-of-date-columns/2503>\
**Category:** KNIME Analytics Platform\
**Created:** [November 28, 2012, 4:56pm UTC](https://forum.knime.com/t/handling-of-date-columns/2503 "2012-11-28T16:56:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fairfield](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/f/c4cdca/32.png) [@Fairfield](https://forum.knime.com/u/Fairfield)\
**Post date:** [November 28, 2012, 4:56pm UTC](https://forum.knime.com/t/handling-of-date-columns/2503/1 "2012-11-28T16:56:38Z")

</div>

Hi,

I have the following question: I wanted to apply Rule Engine node for one column with dates, for example, all dates which are greater than 01.05.2012 mark as 1 and remaining mark as 0. But I got an error message that date is not numeric column (the needed date column was initially in string format). I tried to use String to date node but it didn't help. I want to use dates for different calculations, what should I do to put KNIME read dates properly?

&nbsp;

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![richards99](https://forum-cdn.knime.com/user_avatar/forum.knime.com/richards99/32/48547_2.png) [@richards99](https://forum.knime.com/u/richards99)\
**Post date:** [November 28, 2012, 7:50pm UTC](https://forum.knime.com/t/handling-of-date-columns/2503/2 "2012-11-28T19:50:08Z")

</div>

The string to date node should be the way to go. You need to provide the exact format of the date in the node.

simon.

---

<div class="post-metadata">

**Author:** ![s.roughley](https://forum-cdn.knime.com/user_avatar/forum.knime.com/s.roughley/32/366_2.png) [@s.roughley](https://forum.knime.com/u/s.roughley)\
**Post date:** [November 29, 2012, 8:35pm UTC](https://forum.knime.com/t/handling-of-date-columns/2503/3 "2012-11-29T20:35:29Z")

</div>

Or you can use the 'time difference' node, and set the reference time to 01.05.2012, then positive differences will be before and negative differences after that time - you can then use these in your rule engine or java snippet (return ($time\_diff$\>=0)? 0:1;).&nbsp; You can set the time unit the comparison is in - you probably want 'days' in this case.

Steve

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [June 23, 2023, 8:17pm UTC](https://forum.knime.com/t/handling-of-date-columns/2503/4 "2023-06-23T20:17:55Z")

</div>


