Google给返回的时间是国际标准时间,但客户端必须是本地时间,需要做相应的转换
下面这段代码给出相应的字串转换
- - (id)transformedValue:(id)beforeObject
- {
- GDataDateTime *dateTime = [beforeObject editedDate];
- NSDate * oriDate = dateTime.date;
- NSDate * newDate = [oriDate dateByAddingTimeInterval:[[NSTimeZone localTimeZone] daylightSavingTimeOffset]];
- dateTime = [[[GDataDateTime alloc] initWithDate:newDate timeZone:[NSTimeZone localTimeZone]] autorelease];
- NSString * result = [dateTime stringValue];
- result = [result stringByReplacingOccurrencesOfString:@"T" withString:@" "];
- result = [result stringByReplacingOccurrencesOfString:@"Z" withString:@" "];
- return result ;
- }