DateTime dt = DateTime.Now;
string aa = string.Format("{0:yyyy-mm-dd hh:mm:ss tt }", dt);
string cc = aa.Replace("上午", "am").Replace("下午", "pm");
Response.Write(cc);
时间am pm
http://msdn.microsoft.com/zh-tw/library/c6dw49cz(d=lightweight,v=VS.95).aspx
DateTime.Parse 方法
http://msdn.microsoft.com/zh-cn/library/kc8s65zs.aspx
string.Format 方法
C#日期相关操作
http://www.cnblogs.com/peida/archive/2009/02/19/1394021.html
C#时间格式 AM\ PM
http://www.cnblogs.com/jasonxuvip/archive/2012/02/29/2373727.html
C#日期格式化
http://www.cnblogs.com/wqqblogs/archive/2011/06/14/2080338.html
本文详细介绍了使用C#编程语言进行日期时间格式化,并将时间表述从传统的上午/下午转换为am/pm格式的过程。通过使用`string.Format`方法获取日期时间字符串,并应用`DateTime.Parse`方法进行解析,实现了时间表述的灵活转换。

922

被折叠的 条评论
为什么被折叠?



