DateTime格式转换结果
2024-09-30 00:12:18
Console.WriteLine(string.Format("ToLongDateString:{0}", DateTime.Now.ToLongDateString()));
Console.WriteLine(string.Format("ToLongTimeString:{0}", DateTime.Now.ToLongTimeString()));
Console.WriteLine(string.Format("ToOADate:{0}", DateTime.Now.ToOADate()));
Console.WriteLine(string.Format("ToShortDateString:{0}", DateTime.Now.ToShortDateString()));
Console.WriteLine(string.Format("ToShortTimeString:{0}", DateTime.Now.ToShortTimeString()));
Console.WriteLine(string.Format("ToString:{0}", DateTime.Now.ToString()));
Console.WriteLine(string.Format("ToString(\"yyyy - MM - dd HH:mm:ss.ffff\"):{0}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffff")));
运行结果:
ToLongDateString:2017年9月21日
ToLongTimeString:16:02:30
ToOADate:42999.6684130671
ToShortDateString:2017/9/21
ToShortTimeString:16:02
ToString:2017/9/21 16:02:30
ToString("yyyy - MM - dd HH:mm:ss.ffff"):2017-09-21 16:02:30.8921
最新文章
- linux下php-mysql拓展安装
- Java socket长连接代码实现
- 基于jquery的tips悬浮消息提示插件tipso
- 【UOJ#33】【UR#2】树上GCD 有根树点分治 + 容斥原理 + 分块
- React的第一步
- scrapy 登录
- Rails--bundle exec rake db:migrate
- redis 笔记06 发布与订阅、事务、慢查询日志、监视器
- C++ Template之技巧性基础知识
- 【nodejs】json value出现 undefined 将会无法解析 问题来了
- iOS 数组越界 Crash加工经验
- poj3261 -- Milk Patterns
- 询问任意区间的min,max,gcd,lcm,sum,xor,or,and
- javascript-array函数实例
- 在MyEclipse 2014中给Spket增加ExtJS提示
- 社交系统/社群系统“ThinkSNS+”H5及PC端终于来了!一起来“找茬”
- Python 爬虫 爬校花网!!
- Linux学习之用户身份与文件权限
- IntelliJ IDEA部署tomcat时Edit Configuration Deployment无artifact选项
- Oracle通过Navicat导入表数据与机构,数据无法直接查询,需要加双引号的问题
热门文章
- oracle 中日期的加减
- 为什么 [";1";, ";2";, ";3";].map(parseInt) 返回 [1,NaN,NaN]?
- 【hdu 1527】取石子游戏
- Android Xfermode 真实 实现全面、圆角图片
- JS----checked----checked选中和未选中的获取
- 一道SQL题考你数据库的使用能力
- 手机预览微信小程序
- 前端后端分离,怎么解决SEO优化的问题呢?
- java 中的两个常用命令
- Array.prototype.forEach()&;&;Array.prototype.map()