🦉 🎤   RapidMiner Wisdom 2020 - CALL FOR SPEAKERS   🦉 🎤

We are inviting all community members to submit proposals to speak at Wisdom 2020 in Boston.


Whether it's a cool RapidMiner trick or a use case implementation, we want to see what you have.
Form link is below and deadline for submissions is November 15. See you in Boston!

CLICK HERE TO GO TO ENTRY FORM

How to Add Timestamps

mschmitzmschmitz Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 2,155  RM Data Scientist
edited November 2018 in Knowledge Base

Question

I would like to use a Write or Store operator but tag the result with a timestamp, how do I do this?

Answer

In order to add a timestamp we will use macros. If you do not yet know about macros, please have a look at this article.

 

Using Generate Macro

You can use the Generate Macro operator to generate a new macro named e.g. timestamp. To do this we use the equation:

 

date_str_custom(date_now(),"dd-MM-yy")

 

the format of the date can be changed easily to include for example the second or the minute. This can then be used in the path of store or Write Excel/CSV/... with the standard macro notation. For a Store operator it looks like this:

 

//Local Repository/my data %{timestamp}

 

The corresponding process is attached to this article.

Using Built-In Macros

Instead of creating your own macro, you can also use the built-in macro t. This macro is always available. For the Store example it would be used like this

 

 //Local Repository/my data %{t}

 

This method is faster than the previously mentioned but you cannot change the date format of %{t} without using Generate Macro. The attached process is also showing the usage of t.

- Head of Data Science Services at RapidMiner -
Dortmund, Germany
yyhuang
Sign In or Register to comment.