Skip to main content

Posts

Showing posts with the label Datetimeutil

split datetime in hour minutes second in different timezone in ax 2012

This is the example to  split datetime in hour minutes second in different timezone in ax 2012. 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))); To get different timezone like GMT,India etc you can get from below screen.

Add minutes code in MSD axapta 2009

You can add minutes to datetime following way.ACX_Base::getServerDateTime() method is used to get server current date time and addminutes is a method of datetimeutil class. info(strfmt("%1",DateTimeUtil::addMinutes(ACX_Base::getServerDateTime(), 540)));