Playing around with Date, utcDateTime and DateTimeUtil in AX2012

In this short post I would like to show you, how to play around with dates in AX2012, for the beginning let’s just manipulate a given utcDateTime, later we will see how to convert dates to utcDateTime.
To do so, the class DateTimeUtil is a good point to look at.

Add a year, month, day, hour, minute or second to a given utcDateTime

Let’s start with adding a year to today’s date.

The other operations are very similar:

Pass a negative integer to substract a given value from youre utcDateTime.