Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cocoa touch NSDateFromString,解析过去的日期_Cocoa Touch_Date_Date Parsing - Fatal编程技术网

Cocoa touch NSDateFromString,解析过去的日期

Cocoa touch NSDateFromString,解析过去的日期,cocoa-touch,date,date-parsing,Cocoa Touch,Date,Date Parsing,我正在执行此代码以解析日期1800年1月1日: NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@"ddMMyyyy"]; NSDate *date = [formatter dateFromString:@"01011800"]; 当我用 NSLog(@"%@", date); 我明白了 我的预期结果是1799-12-31 23:00:00+0000:我在中欧,在1月

我正在执行此代码以解析日期1800年1月1日:

NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"ddMMyyyy"];
NSDate *date = [formatter dateFromString:@"01011800"];
当我用

NSLog(@"%@", date);
我明白了


我的预期结果是
1799-12-31 23:00:00+0000
:我在中欧,在1月1日,我对UTC有1.00小时的偏移量,但我不明白这10分4秒是从哪里来的。

在互联网上仔细看看过去几百年来你们地区的时区变化。打赌结果实际上是正确的,在1800年,你的本地时区偏离了10分4秒


对于1800年的日期,苹果显然没有使用今天的时区信息,而是214年前的时区信息

我相信苹果的计算结果是好的。我只是想了解这些数据是从哪里来的
1799-12-31 23:10:04 +0000