From d5d97db8e8d64ddbc0797325ce023723fd1227bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20J=2E=20Hern=C3=A1ndez=20Blasco?= Date: Fri, 16 Jan 2015 00:02:01 +0100 Subject: [PATCH] oc: PT_SYSTIME is an absolute timestamp As the epoch is in UTC timezone, we set this timezone for NSCalendarDate. --- OpenChange/MAPIStoreObject.m | 16 ---------------- OpenChange/MAPIStoreTypes.m | 1 + 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/OpenChange/MAPIStoreObject.m b/OpenChange/MAPIStoreObject.m index 1c4b26be4..ecb00dba3 100644 --- a/OpenChange/MAPIStoreObject.m +++ b/OpenChange/MAPIStoreObject.m @@ -23,7 +23,6 @@ #import #import #import -#import #import #import #import @@ -245,13 +244,8 @@ static Class NSExceptionK, MAPIStoreFolderK; struct SPropValue *cValue; NSUInteger counter; NSMutableDictionary *newProperties; - NSTimeZone *tz; - NSInteger tzOffset; id value; - tz = nil; - tzOffset = 0; - newProperties = [NSMutableDictionary dictionaryWithCapacity: aRow->cValues]; for (counter = 0; counter < aRow->cValues; counter++) { @@ -268,16 +262,6 @@ static Class NSExceptionK, MAPIStoreFolderK; @"attempting to set string property as PR_STRING8: %.8x", cValue->ulPropTag]; break; - case PT_SYSTIME: - if (!tz) - { - tz = [[self userContext] timeZone]; - tzOffset = -[tz secondsFromGMT]; - } - value = [value addYear: 0 month: 0 day: 0 - hour: 0 minute: 0 second: tzOffset]; - [value setTimeZone: tz]; - break; } [newProperties setObject: value forKey: MAPIPropertyKey (cValue->ulPropTag)]; diff --git a/OpenChange/MAPIStoreTypes.m b/OpenChange/MAPIStoreTypes.m index 01b650463..76e72c5d6 100644 --- a/OpenChange/MAPIStoreTypes.m +++ b/OpenChange/MAPIStoreTypes.m @@ -119,6 +119,7 @@ NSObjectFromMAPISPropValue (const struct mapi_SPropValue *value) break; case PT_SYSTIME: result = [NSCalendarDate dateFromFileTime: &(value->value.ft)]; + [result setTimeZone: utcTZ]; break; case PT_BINARY: case PT_SVREID: