Datetime format

来源:互联网 发布:配餐软件有哪些 编辑:程序博客网 时间:2024/05/21 10:43

some times you need to change the datetime culture to match other module calls  in project  .


using ParseExact method .

string[] formats = {Constant.DDMMMMYYYY,Constant.DDMMMYYYY,Constant.DDMMYYYY,Constant.YYYYMMDD}; var  dt = DateTime.ParseExact(kivDueDate, formats, new CultureInfo("en-US"), DateTimeStyles.None);