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)));

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s