Microsoft_MVP_banner

Format the system date in Dynamics AX


The following code show the dates in format like December 22, 2011


static void datesJob(Args _args)
{
    str dd, mm, yy, dt;

    dt = date2Str(systemDateGet(), 123, DateDay::Digits2, DateSeparator::Slash, DateMonth::Digits2,
           DateSeparator::Slash, DateYear::Digits4);

    dd = substr(dt, 0, 2);
    mm = substr(dt, 4, 2);
    yy = substr(dt, 7, 4);

    dt = mthname(str2int(mm)) + ‘ ‘ + dd + ‘, ‘ + yy;

    print   dt;
    pause;
}

Share:

Send Us A Message

Leave a Reply

Your email address will not be published. Required fields are marked *

FaisalFareed@2025. All rights reserved

Design by T3chDesigns