<code> NSString *strSrcDate=@
"2016年2月1日"
;
NSTimeZone *timeZone=[NSTimeZone timeZoneWithAbbreviation:@
"GMT"
];
NSDateFormatter *fmt=[[NSDateFormatter alloc]init];
fmt.dateFormat = @
"yyyy年MM月dd日"
;
fmt.timeZone = timeZone;
NSDateFormatter *dstFmt=[[NSDateFormatter alloc]init];
dstFmt.dateFormat = @
"yyyy-MM-dd"
;
dstFmt.timeZone = timeZone;
NSDate *srcDate=[fmt dateFromString:strSrcDate];
NSLog(@
"date converted from %@ to %@"
,strSrcDate,[dstFmt stringFromDate:srcDate]);</code>