45) DATE FUNCTIONS SNIPPET IN D365 FINANCE & OPERATIONS & MICROSOFT DYNAMICS AX

  • Get maximum date : TransDate maximumDate = dateMax();

  • Get minimum date: TransDate minimumDate= datenull();

  • Get Current or today’s Date: TransDate todayDate = today();

  • Convert string to date:  TransDate transdate = str2Date(’26-06-2020′, 123);(day = 1, month = 2, year = 3)

  • Convert date to string: str dateStr = date2Str(today(), 123, DateDay::Digits2, 
  • DateSeparator::Hyphen, DateMonth::Digits2, DateSeparator::Hyphen, DateYear::Digits4, 0);

  • Convert String to datetime: utcdatetime dateTime = str2Datetime(‘26.06.2020 11:00:00 pm’, 123);

  • Get current system date time : utcdatetime currentDateTime = DateTimeUtil::getSystemDateTime();

  • Get current system date : Transdate currentDate = DateTimeUtil::getSystemDate();

  • getCompanyTimeZone = DateTimeUtil::getCompanyTimeZone();

  • getUserPreferredTimeZone = DateTimeUtil::getUserPreferredTimeZone();

  • getClientMachineTimeZone = DateTimeUtil::getClientMachineTimeZone();// get clie

  • getOriginatingTimeZone = DateTimeUtil::getOriginatingTimeZone(transDateTime); // get originating time zone

  • dateTime = DateTimeUtil::minvalue(); // get minimum value of date time

  • dateTime = DateTimeUtil::maxvalue(); // get maximum value of date time

Comments

Popular posts from this blog

Customization on Sales invoice Report in D365 F&O

75) COC - Create a coc of the table modified method

46) D365 FO: SHAREPOINT FILE UPLOAD USING X++