string.Format 格式化输出日期
2016-03-05 15:40
281 查看
string.Format("{0:d}",System.DateTime.Now) 结果为:2009-3-20 (月份位置不是03)
string.Format("{0:D}",System.DateTime.Now) 结果为:2009年3月20日
string.Format("{0:f}",System.DateTime.Now) 结果为:2009年3月20日 15:37
string.Format("{0:F}",System.DateTime.Now) 结果为:2009年3月20日 15:37:52
string.Format("{0:g}",System.DateTime.Now) 结果为:2009-3-20 15:38
string.Format("{0:G}",System.DateTime.Now) 结果为:2009-3-20 15:39:27
string.Format("{0:m}",System.DateTime.Now) 结果为:3月20日
string.Format("{0:t}",System.DateTime.Now) 结果为:15:41
string.Format("{0:T}",System.DateTime.Now) 结果为:15:41:50
string.Format("{0:D}",System.DateTime.Now) 结果为:2009年3月20日
string.Format("{0:f}",System.DateTime.Now) 结果为:2009年3月20日 15:37
string.Format("{0:F}",System.DateTime.Now) 结果为:2009年3月20日 15:37:52
string.Format("{0:g}",System.DateTime.Now) 结果为:2009-3-20 15:38
string.Format("{0:G}",System.DateTime.Now) 结果为:2009-3-20 15:39:27
string.Format("{0:m}",System.DateTime.Now) 结果为:3月20日
string.Format("{0:t}",System.DateTime.Now) 结果为:15:41
string.Format("{0:T}",System.DateTime.Now) 结果为:15:41:50
相关文章推荐
- 【论文学习笔记】Clustering by fast search and find of density peak
- oracle EBS中使用PLSQL提交"关闭离散"并发请求
- 随机生成30道四则运算
- java中jar包反编译以及遇到转换失败时的对策
- Android快速开发系列 10个常用工具类
- 2016年的C++常见的面试问题详解~搬至牛客网~strcpy
- vim配置文件
- ssm框架整合笔记-2-简化配置
- 魏昊卿——《Linux内核分析》第二周作业:了解操作系统是怎样工作的
- css3 calc()自适应布局属性
- SQL常用指令
- Rendering Problems invalid drawable tag vector android studio 显示问题
- 网站开发周期
- 【论文学习笔记】Face Recognition with Learning-based Descriptor
- java自动内存管理的偏爱
- 欢迎使用CSDN-markdown编辑器
- DataBase -- Employees Earning More Than Their Managers My Submissions Question
- python学习---模拟人生
- 蓝桥杯 历届试题 扑克序列
- 消息摘要算法的编程使用