Interview Questions

Monday, July 7, 2014

Details information for Print date in AX through X++

//Detailed information of Date Print
static void PrintDate(Args _args)
{
info(date2str(systemdateget(),123,2,1,2,1,4));
}

//Here in the INFO line:
1. 123 = Date Month and Year
You can change the order as per your requirement like. 123, 321, 213

2. Systemdateget()= Through this method you will get current system date

3. After 123 the digit 1 is used to show blank space after Date.
Example : 01 01 2014
You can change it with 1 to 4.
          1 Means Space between date and month and Year
     Example : 01 01 2014
          2 Means Dot(.) between date and month and Year
    Example : 01.01.2014
          3 Means Dash(-) between date and month and Year
    Example : 01-01-2014
          4 Means slash (/) between date and month and Year
    Example : 01/01/2014

4. Now in Info Line 2,1,2,1,4
    Here 2 Means Date's Digit
             1 Means Blank Space
             2 Means Month's Digit
             1 Means Blank Space
             4 Means number of Year's Digit

No comments:

Post a Comment