- (NSDate *)getNowDateFromatAnDate:(NSDate *)anyDate
{
//設置源日期時區
NSTimeZone* sourceTimeZone = [NSTimeZone timeZoneWithAbbreviation:@"UTC"];//或GMT
//設置轉換后的目標日期時區
NSTimeZone* destinationTimeZone = [NSTimeZone localTimeZone];
//得到源日期與世界標准時間的偏移量
NSInteger sourceGMTOffset = [sourceTimeZone secondsFromGMTForDate:anyDate];
//目標日期與本地時區的偏移量
NSInteger destinationGMTOffset = [destinationTimeZone secondsFromGMTForDate:anyDate];
//得到時間偏移量的差值
NSTimeInterval interval = destinationGMTOffset - sourceGMTOffset;
//轉為現在時間
NSDate* destinationDateNow = [[NSDate alloc] initWithTimeInterval:interval sinceDate:anyDate];
return destinationDateNow;
}