Some Method To Control Date In Axapta - Song Nghia - Technical Consultant

Dynamic 365 FO Dynamic 365 Retail

Thứ Ba, 12 tháng 12, 2017

Some Method To Control Date In Axapta

Some Method To Control Date In Axapta

Trainee: Song Thanh Nghia

DateTimeUtil: A date time manipulation utility class. Some of its methods are referenced below too

DateTimeUtil::getSystemDateTime(): Works like a Now() method

DateTimeUtil::addMonths(): Add n months to the provided date

dayOfMth(date): Calculates the number of the day in the month for the specified date.

I usually use this method to create new date - so easy to make date time

mkDate(int month, day, year)- Creates a date based on three integers, which indicate the day, month, and year, respectively.

prevYr(date) - Retrieves the date in the previous year that corresponds most closely to the specified date. Similar functions include prevMth() and prevQtr()

dateMthFwd(date, int qty): Adds the specified number of months to a date.