首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

变换东一到东八相差八小时时间

2012-07-01 
转换东一到东八相差八小时时间+(NSDate *)convertDateToLocalTime:(NSDate *)forDate {NSTimeZone *nowTim

转换东一到东八相差八小时时间
+(NSDate *)convertDateToLocalTime:(NSDate *)forDate {
    NSTimeZone *nowTimeZone = [NSTimeZone localTimeZone];
    int timeOffset = [nowTimeZone secondsFromGMTForDate:forDate];
   
    NSDate *newDate = [forDate dateByAddingTimeInterval:timeOffset];   
    return newDate;
}

热点排行