Solved

Exchange ActiveSync UTC for Calendar Items

Posted on 2014-01-06
10
359 Views
Last Modified: 2014-01-20
Color me a bit confused. I am attempting to write an IOS client application to communicate with Exchange ActiveSync and display calendar information. But I am seeing some conflicting information in the protocol docs when compared to what I am getting from Exchange. Either that or I am somehow misinterpreting one or the other.

My intent is to save an appointment in my local database in Coordinated Universal Time and then have the UI read in the information and display it as appropriate to the local timezone. In this way an recurring appointment created before daylight saving time for Noon will still be at the same time of day in local time as an appointment created during daylight saving time for noon. But they are not.

My understanding of the documentation is as such:

In MS-ASCAL pdf section 2.2.2.40 (roughly page 34) it says for Start Time that : ...the value of this element is a dateTime data type as specified in MS-ASDTYPE section 2.3.

Moving to MS-ASDTYPE section 2.3 (roughly page 7) the dateTime value is specified in the format of ISO-8601 and all dates are given in Coordinated Universal Time (UTC)

Looking up coordinated universal time I see that UTC does not changed with the seasons as local or civil time does and therefore DOES NOT support daylight saving time. This makes sense, as DST is decidedly local and is ignored by many areas. You cannot know from the perspective of UTC whether or not to apply a DST offset without knowing what timezone and area the time represents, therefore no daylight saving time can be supported. Based on this information I should be able to just slap the dates into my database as they are and merely have the UI adjust itself to display them properly.

However, as a tested I began seeing a divergence of an hour between the two appointments in the database before the UI has even read them. To confirm this I created two recurring appointments representing Lunch at 12 noon local time. One that starts on March 1st 2014 (Standard Time) and one that starts on March 10th 2014 (daylight saving time) in the eastern timezone. This should be March X 2014 at 1700 hours in both cases should it not?



In the WBXML/XML that I am receiving I am getting two different times. The appointment that starts during standard time gives me a start time of 20140301T170000Z. The appointment that starts after daylight saving time is in effect locally gives me 20140301T160000Z.

The difference between the two times is 1 hour, which is the daylight saving time offset. It is my perception based on everything that I have read both in the microsoft protocol documentation and outside it that these two times should be the same and that whatever client that gets to display them should be the one putting the offset in place as needed. Noon local time is noon local time but local time is the province of the local municipality/timezone, not that of UTC.



So my question is what exactly is going on here? Are the start/stop/date stamp date times in UTC or not. If they are in UTC, then why are they offset by an hour instead of being at the same time? Obviously outlook displays these correctly for local time, because both appear at noon. But in my case my database contains locally adjusted times instead of the UTC times I thought I was getting which is throwing off when those appointments appear in the UI.



Can someone please clarify what's going on here and what I should be seeing?



Thanks.
E
0
Comment
Question by:lrwdigital
  • 5
  • 4
10 Comments
 
LVL 68

Accepted Solution

by:
Qlemo earned 225 total points
ID: 39791528
What you get is correct. 01-MAR-2014 12:00pm is +5, as expected. 10-MAR-2014 12:00pm is +4(!) because of DST. As stated correctly, Zulu time (UTC) is not changing with DST, but your time is.
0
 

Author Comment

by:lrwdigital
ID: 39794184
Thanks for the response.

I agree that Zulu time shouldn't be changing. But that's not what I am seeing from exchange, hence my confusion.

If I create an appointment for 12pm UTC, it should still be 12pm UTC no matter what time of year it is shouldn't it?  Because UTC doesn't support Daylight saving time?

It is up to the client to figure out what 12pm UTC is in local time because perhaps today the client is in New York City EST but tomorrow the client is in Istanbul. If exchange is already applying the daylight saving time offset for EST then i would need to remove it before I can switch timezones or the time will be off in the new timezone.
0
 
LVL 68

Expert Comment

by:Qlemo
ID: 39794377
Obviously you are overlooking that the appointments are set via the UI, and hence are subject to DST and timezone settings before they get into the DB ...
0
 

Author Comment

by:lrwdigital
ID: 39794511
So you're saying that because these appointments were created in outlook, they're being tagged with my local timezone and that's why I'm seeing this difference?
0
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
LVL 68

Expert Comment

by:Qlemo
ID: 39794987
Correct.
0
 

Author Comment

by:lrwdigital
ID: 39795390
So the docs are incorrect then and I need to strip off the DST bias as needed before I stick it in my DB. *sigh*
0
 

Author Comment

by:lrwdigital
ID: 39795421
I've requested that this question be closed as follows:

Accepted answer: 0 points for lrwdigital's comment #a39795390

for the following reason:

The person who answered explained exactly what was going on.
0
 
LVL 68

Expert Comment

by:Qlemo
ID: 39795422
Didn't you intend to accept one of my comments?
0
 

Author Comment

by:lrwdigital
ID: 39795441
Sorry, thought I did. Must have hit the wrong one or something.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
Easy CSR creation in Exchange 2007,2010 and 2013
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
how to add IIS SMTP to handle application/Scanner relays into office 365.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now