How can I set 5 hours back?

blatoo
blatoo New Altair Community Member
edited November 2024 in Community Q&A
I have an attribute "time" in my data set, the value is like "2010-03-09T08:51:34", I want to set 5 hours back.

So I did following thing:
  • "Nominal to Date", so the attribute will be turned to date format
  • "generate attribute", the new attribute has the expression: date_add(time, -5)
but this doesn't work. Error: Invalid number of arguments for 'data_add', must be either 3 or 5.

How can I set 5 hours back for the "time"???
Tagged:

Answers

  • Marco_Boeck
    Marco_Boeck New Altair Community Member
    Hi,

    you're looking for that:

    date_add(date, -5, DATE_UNIT_HOUR)
    Currently, you can have a look at the tooltip of each function for details and examples. However the whole dialog will be revamped in the future because it's not very good at the moment.

    Regards,
    Marco
  • blatoo
    blatoo New Altair Community Member
    Hi Marco,

    thanks very much for the quick answer! The part about time is one of most confused thing for me. I am really happy to hear about this news! Thank you, all guys in rapidminer!