date2Str function in X++


27/11/2020- duocnt    1686 Views    

MỤC ĐÍCH

Chuyển giá trị kiểu date thành kiểu Str.


Code x++

date        _parmDate;
_parmDate   =  PurchDeliveryDate.dateValue();
if(_parmDate)
{
   str _date2Str =  date2Str(_parmDate,                                 123,                                 DateDay::Digits2,                                 DateSeparator::Hyphen,                                 DateMonth::Digits2,                                 DateSeparator::Hyphen,                                 DateYear::Digits4);
    info(strFmt("Selected date is %1",_date2Str));
}

Trong đó:

 - 123 <=> 1 = day, 2 = month, 3 = year.

Kết quả:


Góp ý kiến

;
;