Pages

Banner 468 x 60px

 

Thursday, December 25, 2014

Microsoft Dynamics AX Dates And Time functions

0 comments
today() ————————————>The today function returns the system date,This function does not support time zones. getSystemDateTime() —————>Gets the current UTC time as a utcdatetime type.
systemDateGet () ———————->The systemDateGet method uses the system date in Microsoft Dynamics AX.
  • Use DateTimeUtil::getSystemDateTime instead of systemDateGet or today. The today function uses the date of the machine. The systemDateGet method uses the system date in Microsoft Dynamics AX. Only DateTimeUtil::getSystemDateTime compensates for the time zone of the user.
  • Avoid using date2str for performing date conversions.
currentDateTime = DateTimeUtil::applyTimeZoneOffset(DateTimeUtil::utcNow(), DateTimeUtil::getUserPreferredTimeZone());
Job
date d;
str time1=”0.50″;
TimeOfDay time;
time = str2time(time1); ———————————————————> convert the String to Date
info(strFmt(“%1″,dayName(dayOfMth(today())))); ———————-> Name of the day in String
print dateMthFwd(systemdateget(),5);  ————————————>  forward to the 5 months
print dateMthFwd(systemdateget(),-5); ————————————> Backward to the 5 Months
 pause;
 Date to String Conversion
info(date2str(today(),123,2,2,2,2,4));
info(date2str(systemDateGet(),123,2,2,2,2,4));
info(date2str(DateTimeUtil::date(DateTimeUtil::getSystemDateTime()),123,2,2,2,2,4));
Get the time in milliseconds
str  milliSecondsAlive = int2str(winApi::getTickCount()); ——————–> Time in MilliSec
str  timeStr;
timeStr = strFmt(“%1 %2″, time2str(timeNow(), 3, 1), substr(milliSecondsAlive, strlen(milliSecondsAlive)-2, 2));
Date And Time Stuff
    str time1=”0.50″;
    TimeOfDay time;
    time = str2time(time1);
    info(strFmt(“%1″,time));                                                                   //convert time ToDate string
    info(strFmt(“%1″,dayName(dayOfMth(today()))));           // Name of the Day in String

0 comments:

A financial dimension value is based on the record and has been used on a transaction. You cannot delete the record

  SOLUTION delete in table DimensionAttributeLevelValue base on Bank Account  :  and Delete the Bank Account FINISH