"Bug: date_get(date_now(),DATE_UNIT_MONTH) gives 1 for February"
Hello dear support,
this function has a bug: date_get(date_now(),DATE_UNIT_MONTH) give "1" for February (actual month). Could you please fix this?
<?xml version="1.0" encoding="UTF-8"?><process version="7.2.002">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="7.2.002" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="generate_macro" compatibility="7.2.002" expanded="true" height="68" name="Generate Macro (2)" width="90" x="380" y="493">
<list key="function_descriptions">
<parameter key="cur_date_month" value="date_get(date_now(),DATE_UNIT_MONTH)"/>
</list>
</operator>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
</process>
</operator>
</process>
Thanks!
Best Answer
-
Thomas_Ott RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,761 Unicorn
Not a bug, January is set at "0"
See this thread: http://community.rapidminer.com/t5/RapidMiner-Studio/Generate-Attribute-problems-Solved/td-p/18964
0
Answers
Thank you a lot!
Just to know: why is it so? And why take a year, day and hour "normal" values (if I am correct)?
I don't have an answer as to why it's that way, I'm not a Java devleoper but I think it could be related to the Epoch calculations.
Hi,
the Expression Parser in RapidMiner Studio is utilizing the Java Calendar and a long time ago SUN decided to to start with the index 0 (see the corresponding JavaDoc). This was probably done because months have names and are often mapped via monthNames[MONTH].
Cheers,
Marcel