D365FO – AX – Convert String to Date (str2Date)

This function is used to convert the specified string to a date value. There is 2 parameters in this function :

  1. _text : The string to convert to a date value.
  2. _sequence : A three digit integer that describes the positions of the day, month, and year in the string to convert (day = 1, month = 2, year = 3). For example, if we want to use year, month, day, we must write 321.

Example :

static void str2DateExample(Args _arg)
    date d;
    d = str2Date("22/2/2017", 123);
    info(strfmt("%1", d));

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s