"Bug: date_get(date_now(),DATE_UNIT_MONTH) gives 1 for February"

john_wujohn_wu MemberPosts:2Contributor I
edited June 2019 inHelp

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?





<宏/ >












Thanks!

Tagged:

Best Answer

Answers

  • john_wujohn_wu MemberPosts:2Contributor I

    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)?

  • Thomas_OttThomas_Ott RapidMiner Certified Analyst, RapidMiner Certified Expert, MemberPosts:1,761Unicorn

    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.

  • mmichelmmichel Employee, MemberPosts:129RM Engineering

    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 correspondingJavaDoc). This was probably done because months have names and are often mapped via monthNames[MONTH].

    Cheers,

    Marcel

    Thomas_Ott
Sign InorRegisterto comment.