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

Community site session details

Session Id :
Dynamics 365 Community / Blogs / NevoiTech AX Blog / How to create date using x++

How to create date using x++

Moeen Ahmed Sultan Profile Picture Moeen Ahmed Sultan 1,402

In every programming language, playing with date and time is always complex. As, date has different formats, different regional norms to write and more importantly different ways to store in the memory. In my this article, you will learn how to create date using x++.

Let’s start!

I am sharing a function of x++ which needs three arguments and all in integer data type. These arguments are as follows:

  • day
  • month
  • year

Now, you need to pass these three arguments to the mkDate(int day, int month, int year) function of x++. See the code below:

mkDate(1,12,1900)));
info(strFmt("%1", mkDate(1,12,1900)));

So, in this way you can create date using x++. Moreover, if this helps you, please Like, Comment and Share to help other people.

Note: I have tested this code is tested in D365FO but not in AX 2012.

If you found any ambiguity or a better solution, please feel free to ask.

Blog: Click here

YouTube: Click here

GitHub: Click here

The post How to create date using x++ appeared first on NevoiTech Blog.

Comments

*This post is locked for comments