0

将格鲁吉亚日期转换为回历日期时出现以下错误:

System.FormatException: '字符串未被识别为有效的日期时间。'

我的代码如下:

string dateString;
string format = "M/dd/yyyy";
DateTime result;
CultureInfo arSA = new CultureInfo("ar-SA");
arSA.DateTimeFormat.Calendar = new UmAlQuraCalendar();

DateTime dt = 1/6/2018 12:00:00 AM;

result = DateTime.Parse(dt.ToString());

dateString = result.ToShortDateString(); //dateString => "1/6/2018"

result = DateTime.ParseExact(dateString, format, arSA); //Getting error here
4

0 回答 0