DateTime类型ToString时要显示AM/PM怎么办
来源:互联网 发布:打码软件 编辑:程序博客网 时间:2024/06/08 00:06
DateTime类型ToString时要显示AM/PM怎么办
- DateTime time = DateTime.Now;
- string s = time.ToString("yyyy.MM.dd hh:mm:ss t\\M");
- Console.WriteLine(s);
Explanation: t
gives the first character of the AM/PM designator (the localized designator can be retrieved inDateTimeFormatInfo.AMDesignator
and DateTimeFormatInfo.PMDesignator
). The \\M
escapes the M
so that DateTime.ToString
does not interpret it as part of the format string and print the numerical value of the month.
Note that once you do this you are explicitly being culture insensitive. For example, in Japan, the AM/PM designator differs in the second characters, not the first.
- DateTime类型ToString时要显示AM/PM怎么办
- DateTime类型ToString时要显示AM/PM怎么办
- DateTime类型ToString时要显示AM/PM怎么办
- AM PM
- AM PM
- DateTime.ToString()的几种显示格式
- 带AM或者PM的时间字符串转data类型
- adb shell am/pm 开启activity 显示package info
- Android4.1.1添加12小时制AM/PM显示
- DateTime ToString
- DateTime日期类型格式化显示
- DateTime日期类型格式化显示
- DateTime日期类型格式化显示
- DateTime日期类型格式化显示
- am,pm,app_process
- android am pm命令
- android am/pm帮助
- AM与PM
- 第三界蓝桥杯软件大赛预赛(答案二)
- PCRE接口pcre_fullinfo混合子模式调用结果
- MD5值
- 免费素材大荟萃:免费图标和UI设计
- TNSNAMES.ORA 配置
- DateTime类型ToString时要显示AM/PM怎么办
- Linux(Centos) 加硬盘,分区和设置自动挂载
- 取得手机屏幕大小/style的应用技巧
- HDU1607--二分图最大匹配
- 程序人生-4-我的2012
- test
- 免费的SQL Server监控工具
- Centos phpmyadmin 安装及注意事项
- datagridview不显示空值&&只导出显示出的数据(去掉隐藏列)