web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

get current date format of user

(0) ShareShare
ReportReport
Posted on by

How can I get the current day format of the current user (whether is dd/mm/yy or yy/mm/dd etc.)?

Thanks :)

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,795 Most Valuable Professional on at

    Do you mean the short date format set up in Windows on user's client machine?

  • Community Member Profile Picture
    on at

    Yes.

  • Verified answer
    Martin Dráb Profile Picture
    237,795 Most Valuable Professional on at

    Try this:

    System.Globalization.DateTimeFormatInfo formatInfo = System.Globalization.DateTimeFormatInfo::get_CurrentInfo();
    str shortDatePatten = formatInfo.get_ShortDatePattern();
  • Community Member Profile Picture
    on at

    you can use this method

    display str FinalTXT()

    {

    return   'From:  ' + dayname(dayofwk(fromdate)) + ' ' + date2str(fromdate,123,DateDay::Digits2,DateSeparator::slash,DateMonth::Digits2,

                  DateSeparator::slash, DateYear::Digits4) + '  To:   ' + dayname(dayofwk(todate)) + ' '

         + date2Str(todate,123,DateDay::Digits2,DateSeparator::slash,DateMonth::Digits2,

                  DateSeparator::slash, DateYear::Digits4) + '   Time:  '  + time2Str(timenow(), TimeSeparator::Colon, TimeFormat::AMPM) ;

    }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans