Issues with Timesaving when using dateadd functions
I am trying to create financial period start and end dates using the expressions: addMonthsUTC(trimToMonths($Parameters/FinancialYearStart), $Counter-1) and addSeconds( addMonthsUTC( trimToMonths($Parameters/FinancialYearStart), $Counter), -1) However I am getting results offset by +one hour in April to October for the first expression and March to September for the second. The variable FinancialYearStart is a DateTime value and counter an integer from 1 to 12. I have tried both the UTC and Server time versions of addMonths function. Is there a way round this behaviour? Ideally I would like to ignore the time and just work to the date part of the DateTime.
Date creation can indeed be tricky at time. The behaviour you see is the winter summer time change when creating the date. First make sure that lokalize is off for the entity. Also it is good practise when creating a date to also fill the time part (so datecreation with all six parameters, see the Date creation documentation).