How can I set 5 hours back?

blatooblatoo Member Posts: 32 Contributor II
edited November 2018 in Help
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"???

Answers

  • Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,993 RM Engineering
    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
  • blatooblatoo Member Posts: 32 Contributor II
    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!
Sign In or Register to comment.