我需要“ 24/01/2012”,但为什么总是返回“ 24/1/2012”

当我使用这个

txtFilingStartDate.Text = String.Format("{0:dd/MM/yyyy}", (SessionHelper.SearchFilingStartDate.Value.Day.ToString() + "/" + SessionHelper.SearchFilingStartDate.Value.Month.ToString() + "/" + SessionHelper.SearchFilingStartDate.Value.Year.ToString()));

最佳答案

只需这样做:

txtFilingStartDate.Text = String.Format("{0:dd/MM/yyyy}",SessionHelper.SearchFilingStartDate.Value);

关于c# - C#中的日期时间格式,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/34921860/

10-08 21:41