Показать сообщение отдельно
Старый 20.08.2020, 00:14   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
a33ik: Parse string to date format
Источник: http://daxonline.org/1702-parse-stri...te-format.html
==============

Parse date string of different formats to AX utcDateTime format:

System.Globalization.CultureInfo culture = System.Globalization.CultureInfo::get_InvariantCulture();utcDateTime dt;try{ dt = System.DateTime::ParseExact('10/17/2020 0:00', 'MM/dd/yyyy H:mm', culture); dt = System.DateTime::ParseExact('1 Jan 2020', 'dd MMM yyyy', culture);}catch{ // handle format exceptions if required}DateTime.ParseExact()


Источник: http://daxonline.org/1702-parse-stri...te-format.html