设置时间格式
2015-08-20 15:32
323 查看
//设置时间格式
NSDateFormatter *inputFormatter = [[NSDateFormatter
alloc] init];
[inputFormatter setLocale:[[NSLocale
alloc] initWithLocaleIdentifier:@"en_US"]];
[inputFormatter setDateFormat:@"yyyyMMdd"];
NSDate* inputDate = [inputFormatter
dateFromString:self.birthDay.text];
NSLog(@"时间格式 = %@", inputDate);
NSDateFormatter *inputFormatter = [[NSDateFormatter
alloc] init];
[inputFormatter setLocale:[[NSLocale
alloc] initWithLocaleIdentifier:@"en_US"]];
[inputFormatter setDateFormat:@"yyyyMMdd"];
NSDate* inputDate = [inputFormatter
dateFromString:self.birthDay.text];
NSLog(@"时间格式 = %@", inputDate);
相关文章推荐
- Android实例-使用自定义字体文件(XE8+小米2)
- Distributed Transaction Coordinator 无法启动
- mysql source 乱码
- LeetCode "Shortest Word Distance"
- Dave SDK help-content-------Resource Group
- 创建git项目并同步到远程仓库的最简单步骤和常用操作。
- php 16进制压缩
- 虚拟文件系统——更好的文件抽象层
- 正则表达式在线测试工具
- 00-自测5. Shuffling Machine (20)
- ThinkPHP字符截取函数msubstr()
- Macbook Pro安装Office 2016 for mac
- 生成loading图片
- redis 安装
- sublime text配置php运行环境
- Leetcode 216 Combination Sum III 组合求和
- IOS 获取设备相关特性
- Yuanfang,what do you think ? SDUT 2448
- js自定义类
- 2015.8.1~8.20训练总结