Friday, December 4, 2020

Remove special characters of Date and Time in ax 2012 X++

Hi guys, Today we see how to  Remove special characters of Date and Time in ax 2012 X++.


Run the below job.



 static void FormatDateTimeJob(Args _args)

{

    utcDateTime now = DateTimeUtil::utcNow();


    str formattedOutput;


    now = DateTimeUtil::applyTimeZoneOffset(

    now,

    DateTimeUtil::getClientMachineTimeZone());


    formattedOutput = DateTimeUtil::toFormattedStr(

        now,

        321,

        DateDay::Digits2,

        DateSeparator::None,

        DateMonth::Digits2,

        DateSeparator::None,

        DateYear::Digits2,


        TimeSeparator::Colon,

        TimeSeparator::Colon);


    info(formattedOutput);

    info(strRem(formattedOutput,":"+" "));

}

OutPut:







Keep Daxing!!

No comments:

Post a Comment