Question3Replies92Views Karthik K Member since 2016 32 posts PEGA Posted: 2 years agoLast activity: 2 years 6 months ago Closed addMonthsToSameDay : behaving different for 30 and 31 st DatesaddMonthsToSameDay function is behaving differently(as far as I think) for the 30 & 31 st of the months. Please, check the below table:addMonthsToSameDay(java.lang.String theDate, int numOfMonths)For 30 & 31 st, Its skipping the immediate next month and giving a different output than expected.Could you please answer, why its behaving differently for 30 & 31.We are passing numOfMonths as 1.INPUTDAYOUTPUTDAY20171130T000000.000 GMT5th Thursday of Nov20180104T000000.000 GMT1st Thursday of Jan20171031T000000.000 GMT5th Tuesday of Oct20171205T000000.000 GMT1st Tuesday of Dec20171030T000000.000 GMT5th Monday of Oct20171204T000000.000 GMT1st Monday of Dec20170930T000000.000 GMT5th Saturday of Sept20171104T000000.000 GMT1st Saturday of Nov20170830T000000.000 GMT5th Wednesday of Aug20171004T000000.000 GMT1st Wednesday of Oct20170730T000000.000 GMT5th Sunday of July20170903T000000.000 GMT1st Sunday of SeptINPUTDAYOUTPUTDAY20171125T000000.000 GMT4th Saturday of nov20171223T000000.000 GMT4th Saturday of Dec20171129T000000.000 GMT5th Wednesday of Nov20171227T000000.000 GMT4th Wednesday of Dec20171029T000000.000 GMT5th Sunday of Oct20171126T000000.000 GMT4th Sunday of Nov20171020T000000.000 GMT3rd Friday of Oct20171117T000000.000 GMT3rd Friday of Nov20170929T000000.000 GMT5th Friday of Sept20171027T000000.000 GMT4th Friday of Oct20170829T000000.000 GMT5th Tuesday of Aug20170926T000000.000 GMT4th Tuesday of Sept Reporting ×Close popoverFacebookTwitterLinkedinEmail Copy Link Copied! Moderation Team has archived post This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question. Posted: 2 years agoRett_Hean_GCS PEGA replied to Karthik KWhere are you using this function? Is this OOTB? I am not able to find it. Posted: 2 years agoKarthik K PEGA replied to Rett_Hean_GCSWe created a function and we are using the below code: DateTimeUtils dtu = ThreadContainer.get().getDateTimeUtils(); return dtu.addMonthsToSameDay(theDate,numOfMonths); Posted: 2 years agorowlandstilwell_gcs PEGA replied to Karthik KHello, What version of the product are you using as that function call hasn't been static?