gpt4 book ai didi

iphone - 工作日 EEE 的 NSDateFormatter 问题

转载 作者:搜寻专家 更新时间:2023-10-30 20:07:43 24 4
gpt4 key购买 nike

为什么下面的代码会输出:Dday: (null)

NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"EEE HH:mm:ss"];
NSDate *date = [dateFormatter dateFromString:@"Sun 15:00:00"];
DLog(@"Ddate: %@", date);

如果我使用格式 HH:mm:ss 和字符串 15:00:00 我会得到一个有效日期...

干杯伙计

最佳答案

这可能与你的系统/设备的语言环境有关,看看苹果的以下内容

http://developer.apple.com/mac/library/qa/qa2010/qa1480.html

关于iphone - 工作日 EEE 的 NSDateFormatter 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3600748/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com