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.

ax2012 Add a Year to utcDateTime

The other operations are very similar:

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

Convert between utcDateTime and date

ax2012 Change date to utcDateTime and back to date


You may also like...