Rounding Time on quarters of an hour

eldenosoeldenoso Member Posts: 65 Contributor I
edited November 2018 in Help

Hello altogether,

is there a way in RapidMiner to round time? So that for example 00:07, 00:17, 00:31 looks like that 00:15, 00:30, 00:45 (up-rounding every time)

Thank you! :-)

Best Answer

  • Options
    AndrewAndrew RapidMiner Certified Expert, RapidMiner Certified Master, Member Posts: 47 Guru
    Solution Accepted

    Here's a mini example process showing a way to do this. The key is to use Unix times when calculating.




  • Options
    eldenosoeldenoso Member Posts: 65 Contributor I

    I already used the date to numerical operator (minute relative to day), maybe from this startpoint we can find a solution?

  • Options
    MartinLiebigMartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,524 RM Data Scientist


    i think you can use Generate Attributes for this. Might be a longer equation wth quite some date_get and date_set involved..



    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
  • Options
    Telcontar120Telcontar120 Moderator, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,635 Unicorn

    While this is one way to do it, another even simpler way would be to use Date to Numerical to extract the minute relative to the hour from the original date/time stamp, and then use simple modulus division (dividing by 15) inside Generate Attributes to generate an attribute housing the quarter hour value.  If desired then you could use another function to round it the way you want (e.g., round vs floor vs ceiling depending on your desired rounding behavior).


    Brian T.
    Lindon Ventures 
    Data Science Consulting from Certified RapidMiner Experts
Sign In or Register to comment.