以下是两种情况下设置时间为短时间格式.1.在GridView里面只要将DataFormatString属性设置为{0:yyyy-MM-dd},HtmlEncode设置为false即可.2.将一个时间格式的字符串改为其它时间格式可以通过DateTime的帮助,如 DateTime.Parse("2007-5-5 9:5:8").ToShortDateString();
博客园 © 2004-2025 浙公网安备 33010602011771号 浙ICP备2021040463号-3