Thursday, December 22, 2011

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


No comments:

Post a Comment

I will appreciate your comments !

Download large bacpac (sandbox database) to DEV environment much faster

As the LCS website gets slower and slower and the database backups get bigger and bigger.  Use AZCopy to download objects out of LCS asset l...