格式

日期格式:

yyyy:显示年的四位数表示

yy:显示年的两位数表示

MM:月

dd:日

HH:小时的24小时显示格式

hh:小时的12小时显示格式

mm:分钟

ss:秒

例如:当前时间为2010-05-01 14:20:30

String.Format("{0:yyyy/MM/dd}", DateTime.Now)  显示为2010/05/01

String.Format("{0:HH:mm:ss}", DateTime.Now)    显示为14:20:30

posted on 2010-05-18 09:23  NewSunshineLife  阅读(185)  评论(0编辑  收藏  举报

导航