Thursday, November 25, 2021

How to change defaultsystem date format to custom format

Today my post related to how can change default system date format to custom date format.

I have noticed in my organization , specially in finance department they were confused many times related to date provided by other department.

Example: (11/5/2012) ==> It may be 11 MAY 2012 or 5 NOVEMBER 2012.

So I am writing a job to convert default system date form to custom format.


static void defaultDateFormatVScustomDateFormat(Args _args)

{

    date defaultDateFormat;

    Str customDateFormat;


   RNumDateInWordConverter rNumDateInWordConverter;

    rNumDateInWordConverter = new RNumDateInWordConverter();

    defaultDateFormat = systemDateGet();

    customDateFormat = rNumDateInWordConverter.date2strExt(defaultDateFormat,false,true,false);

    info(strFmt("Default Date Format %1",defaultDateFormat));

    info("Custom Date Format "+customDateFormat);

}

OUTPUT



Best regards,

Syed Faiz Abbas

No comments:

Post a Comment

Error The total, internal size of the records in your joined SELECT statement is XXXXX bytes

 Hi Friends, Today users getting error while creating new Vendor in AX 2012 R3. When I was investigating I found that this is due to user Us...