【发布时间】:2012-03-14 21:18:27
【问题描述】:
在我的 sqlite 数据库中,我有一个 NSDate 字段,我使用此代码创建了一个具有唯一名称的图像文件,并根据该日期加载图像。
NSDateFormatter *digitsOnlyDateFormatter = [[NSDateFormatter alloc] init];
[digitsOnlyDateFormatter setDateFormat:@"yyyyMMddHHmmss"];
NSString *imageDateString = [digitsOnlyDateFormatter stringFromDate:[self imageDate]];
如果我从 iphone 设置更改时区并在 db 中添加新记录,则无法加载使用其他时区保存的其他图像。
我认为转换存在问题。 有人可以帮我吗?
【问题讨论】:
标签: ios time timezone nsdate nsdateformatter