AX – D365FO – split datetime in hour minutes second in different timezone

This is the example to  split datetime in hour minutes second in different timezone TransDateTime myDateTime=DateTimeUtil::applyTimeZoneOffset(DateTimeUtil::getSystemDateTime(),Timezone::GMTPLUS0300KUWAIT_RIYADH); int hours; int minutes; int seconds; ; info(datetime2str(myDateTime)); hours=DateTimeUtil::hour(myDateTime); minutes=DateTimeUtil::minute(myDateTime); seconds=DateTimeUtil::second(myDateTime); info(strfmt('Hours %1 - Minutes %2 - Seconds %3',int2str(hours),int2str(minutes),int2str(seconds)));

AX – D365FO – Get first and last day of a month

X++ Get Start Date and End Date of Month Use following methods to get Month Start Date and Month End Date. Pass any date of month in parameter. Month Start Date :  TransDate dateInMonth=today(); TransDate firstDateOfMonth; ; firstDateOfMonth = DateStartMth(dateInMonth); Month End Date : TransDate dateInMonth=today(); TransDate endDateOfMonth; ; endDateOfMonth= endmth(dateInMonth);