Converting a string to DateTime object

前端 未结 5 612
轮回少年
轮回少年 2021-01-16 15:57

I want to convert a string in a specific format to a DateTime.

My specific string format is \"dd-mm-yyyy\".

I cannot do any string

5条回答
  •  借酒劲吻你
    2021-01-16 16:21

    var convertedDate = DateTime.ParseExact("04-05-2010","dd-MM-yyyy",CultureInfo.InvariantCulture);
    

提交回复
热议问题