Hello,
I started to test against Exchange 2010 as provided by
123together.com.
I'm seeing an issue that I hadn't encountered in our private
installation of Exchange 2010: events without recurrence are converted
to US Eastern time, even if the event that was sent to the server had a
different time zone or used UTC.
For normal events, at least the times are converted correctly:
DTEND:20060406T193000Z | DTEND;TZID="(UTC-05:00) Eastern Tim
DTSTART:20060406T190000Z | e (US & C":20060406T153000
DTSTART;TZID="(UTC-05:00) Eastern T
ime (US & C":20060406T150000
So no real harm is done, it merely breaks the automatic testing.
But all-day events get the same treatment and there things go wrong:
SUMMARY:two day event SUMMARY:two day event
DTEND;VALUE=DATE:20060408 | DTEND;VALUE=DATE:20060407
DTSTART;VALUE=DATE:20060406 | DTSTART;VALUE=DATE:20060405
This happens because activesyncd first converts to the time according to
the provided timezone before truncating the time part. In this case that
shifts the event to different days.
Now it becomes unfair and a bit puzzling...
The data that is sent to the server has start/end time aligned to
midnight and uses a time zone that is equivalent to UTC (no bias set).
This is displayed okay by the server.
After creating an all-day event on 20060406 via the web interface (time
zone setting: UTC), it is send to the client like this:
<ApplicationData>
<TimeZone
xmlns="Calendar:">AAAAACgAVQBUAEMAKQAgAEMAbwBvAHIAZABpAG4AYQB0AGUAZAAgAFUAbgBpAHYAZQByAHMAYQBsACAAVABpAG0AZQAAAAAAAAAAAAAAAAAAAAAAAAAAACgAVQBUAEMAKQAgAEMAbwBvAHIAZABpAG4AYQB0AGUAZAAgAFUAbgBpAHYAZQByAHMAYQBsACAAVABpAG0AZQAAAAAAAAAAAAAAAAAAAAAAAAAAAA==</TimeZone>
<DTStamp xmlns="Calendar:">20111207T102434Z</DTStamp>
<StartTime
xmlns="Calendar:">20060406T000000Z</StartTime>
<Subject xmlns="Calendar:">all day event 123</Subject>
<UID
xmlns="Calendar:">040000008200E00074C5B7101A82E0080000000080D6FE69CAB4CC01000000000000000010000000315841722E672440B2CF3933145398E3</UID>
<Organizer_Name
xmlns="Calendar:">pohly-activesync</Organizer_Name>
<Organizer_Email
xmlns="Calendar:">pohly-activesync@syncevolution.org</Organizer_Email>
<Location xmlns="Calendar:"/>
<EndTime xmlns="Calendar:">20060407T000000Z</EndTime>
<Body xmlns="AirSyncBase:">
<Type>1</Type>
<EstimatedDataSize>2</EstimatedDataSize>
<Data></Data>
</Body>
<Sensitivity xmlns="Calendar:">0</Sensitivity>
<BusyStatus xmlns="Calendar:">2</BusyStatus>
<AllDayEvent xmlns="Calendar:">1</AllDayEvent>
<MeetingStatus xmlns="Calendar:">0</MeetingStatus>
<NativeBodyType xmlns="AirSyncBase:">3</NativeBodyType>
</ApplicationData>
The AAAA.. time zone has zero bias and thus everything works.
(process:4844:0xbbbe9c0): libeas-DEBUG:process timezone
AAAAACgAVQBUAEMAKQAgAEMAbwBvAHIAZABpAG4AYQB0AGUAZAAgAFUAbgBpAHYAZQByAHMAYQBsACAAVABpAG0AZQAAAAAAAAAAAAAAAAAAAAAAAAAAACgAVQBUAEMAKQAgAEMAbwBvAHIAZABpAG4AYQB0AGUAZAAgAFUAbgBpAHYAZQByAHMAYQBsACAAVABpAG0AZQAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
=> bias 0, standard bias 0, daylight bias 0, standard '(UTC) Coordinated Universal
Time', daylight '(UTC) Coordinated Universal Time'
Here's the unfair part: sending that same data back still has the same
problem. It shows okay, but gets converted when retrieving.
Why on earth is an event created via the web treated differently than an
event created via ActiveSync, when sending the same data from the client
to the server as the server sends to the client?
Here's the data that gets sent:
<ApplicationData>
<calendar:TimeZone>AAAAACgAVQBUAEMAKQAgAEMAbwBvAHIAZABpAG4AYQB0AGUAZAAgAFUAbgBpAHYAZQByAHMAYQBsACAAVABpAG0AZQAAAAAAAAAAAAAAAAAAAAAAAAAAACgAVQBUAEMAKQAgAEMAbwBvAHIAZABpAG4AYQB0AGUAZAAgAFUAbgBpAHYAZQByAHMAYQBsACAAVABpAG0AZQAAAAAAAAAAAAAAAAAAAAAAAAAAAA==</calendar:TimeZone>
<calendar:UID>20060416T204026Z-4272-727-1-244@gollum</calendar:UID>
<calendar:DTStamp>20060416T204026Z</calendar:DTStamp>
<calendar:StartTime>20060406T000000Z</calendar:StartTime>
<calendar:EndTime>20060407T000000Z</calendar:EndTime>
<calendar:BusyStatus>0</calendar:BusyStatus>
<calendar:Subject>all day event</calendar:Subject>
<calendar:Sensitivity>0</calendar:Sensitivity>
<calendar:AllDayEvent>1</calendar:AllDayEvent>
<calendar:Location></calendar:Location>
<calendar:Categories></calendar:Categories>
<calendar:Attendees></calendar:Attendees>
<airsyncbase:Body>
<airsyncbase:Type>1</airsyncbase:Type>
<airsyncbase:Truncated>0</airsyncbase:Truncated>
<airsyncbase:Data></airsyncbase:Data>
</airsyncbase:Body>
<calendar:Exceptions/>
</ApplicationData>
And this how it comes back:
<Response>
<Fetch>
<Status>1</Status>
<CollectionId xmlns="AirSync:">1</CollectionId>
<ServerId xmlns="AirSync:">1:19</ServerId>
<Class xmlns="AirSync:">Calendar</Class>
<Properties>
<TimeZone
xmlns="Calendar:">LAEAACgAVQBUAEMALQAwADUAOgAwADAAKQAgAEUAYQBzAHQAZQByAG4AIABUAGkAbQBlACAAKABVAFMAIAAmACAAQwAAAAsAAAABAAIAAAAAAAAAAAAAACgAVQBUAEMALQAwADUAOgAwADAAKQAgAEUAYQBzAHQAZQByAG4AIABUAGkAbQBlACAAKABVAFMAIAAmACAAQ
wAAAAMAAAACAAIAAAAAAAAAxP///w==</TimeZone>
<DTStamp xmlns="Calendar:">20111207T110840Z</DTStamp>
<StartTime xmlns="Calendar:">20060406T000000Z</StartTime>
<Subject xmlns="Calendar:">all day event</Subject>
<UID
xmlns="Calendar:">20060416T204026Z-4272-727-1-244@gollum</UID>
<Organizer_Name
xmlns="Calendar:">pohly-activesync</Organizer_Name>
<Organizer_Email
xmlns="Calendar:">pohly-activesync@syncevolution.org</Organizer_Email>
<Location xmlns="Calendar:"/>
<EndTime xmlns="Calendar:">20060407T000000Z</EndTime>
<Body xmlns="AirSyncBase:">
<Type>1</Type>
<EstimatedDataSize>0</EstimatedDataSize>
</Body>
<Sensitivity xmlns="Calendar:">0</Sensitivity>
<BusyStatus xmlns="Calendar:">0</BusyStatus>
<AllDayEvent xmlns="Calendar:">1</AllDayEvent>
<MeetingStatus xmlns="Calendar:">0</MeetingStatus>
<NativeBodyType xmlns="AirSyncBase:">1</NativeBodyType>
</Properties>
</Fetch>
</Response>
(process:5079:0xbbbe340): libeas-DEBUG:process timezone
LAEAACgAVQBUAEMALQAwADUAOgAwADAAKQAgAEUAYQBzAHQAZQByAG4AIABUAGkAbQBlACAAKABVAFMAIAAmACAAQwAAAAsAAAABAAIAAAAAAAAAAAAAACgAVQBUAEMALQAwADUAOgAwADAAKQAgAEUAYQBzAHQAZQByAG4AIABUAGkAbQBlACAAKABVAFMAIAAmACAAQwAAAAMAAAACAAIAAAAAAAAAxP///w==
=> bias 300, standard bias 0, daylight bias -60, standard '(UTC-05:00) Eastern Time
(US & C', daylight '(UTC-05:00) Eastern Time (US & C'
The same happens when syncing (instead of fetching) the item:
<Add>
<ServerId>1:6</ServerId>
<ApplicationData>
<TimeZone
xmlns="Calendar:">LAEAACgAVQBUAEMALQAwADUAOgAwADAAKQAgAEUAYQBzAHQAZQByAG4AIABUAGkAbQBlACAAKABVAFMAIAAmACAAQwAAAAsAAAABAAIAAAAAAAAAAAAAACgAVQBUAEMALQAwADUAOgAwADAAKQAgAEUAYQBzAHQAZQByAG4AIABUAGkAbQBlACAAKABVAFMAIAAmACAAQwAAAAMAAAACAAIAAAAAAAAAxP///w==</TimeZone>
<DTStamp xmlns="Calendar:">20111207T110840Z</DTStamp>
<StartTime
xmlns="Calendar:">20060406T000000Z</StartTime>
<Subject xmlns="Calendar:">all day event</Subject>
<UID
xmlns="Calendar:">20060416T204026Z-4272-727-1-244@gollum</UID>
<Organizer_Name
xmlns="Calendar:">pohly-activesync</Organizer_Name>
<Organizer_Email
xmlns="Calendar:">pohly-activesync@syncevolution.org</Organizer_Email>
<Location xmlns="Calendar:"/>
<EndTime xmlns="Calendar:">20060407T000000Z</EndTime>
<Body xmlns="AirSyncBase:">
<Type>1</Type>
<EstimatedDataSize>0</EstimatedDataSize>
</Body>
<Sensitivity xmlns="Calendar:">0</Sensitivity>
<BusyStatus xmlns="Calendar:">0</BusyStatus>
<AllDayEvent xmlns="Calendar:">1</AllDayEvent>
<MeetingStatus xmlns="Calendar:">0</MeetingStatus>
<NativeBodyType xmlns="AirSyncBase:">1</NativeBodyType>
</ApplicationData>
</Add>
I'm out of ideas. Does anyone have an explanation for this inconsistent behavior?
I'm not even sure where the US Eastern time comes from. Remember, the
user's settings on the server is the UTC time zone. Is there perhaps
anything in the protocol where the device can tell the server what its
current time zone it?
The client first talked to the server when the setting still was Eastern
time. I suspected that the server might have permanently stored that
setting in its device database. But trying again with a different device
ID yields the same Eastern time.
The other inconsistency is in the all day time handling. As seen above,
when the server is set to UTC, it sends an UTC time zone and start/end
time with T000000Z.
When set to something else, for example Berlin, it sends start/end time
such that they align to midnight in that locality:
<TimeZone
xmlns="Calendar:">xP///ygAVQBUAEMAKwAwADEAOgAwADAAKQAgAEEAbQBzAHQAZQByAGQAYQBtACwAIABCAGUAcgBsAGkAbgAsACAAQgAAAAoAAAAFAAMAAAAAAAAAAAAAACgAVQBUAEMAKwAwADEAOgAwADAAKQAgAEEAbQBzAHQAZQByAGQAYQBtACwAIABCAGUAcgBsAGkAbgAsACAAQgAAAAMAAAAFAAIAAAAAAAAAxP///w==</TimeZone>
<DTStamp xmlns="Calendar:">20111207T111753Z</DTStamp>
<StartTime
xmlns="Calendar:">20060405T220000Z</StartTime>
<Subject xmlns="Calendar:">all day event
Berlin</Subject>
<UID
xmlns="Calendar:">040000008200E00074C5B7101A82E00800000000AEC226DDD1B4CC01000000000000000010000000FFEF41BB9D40704BAD4F70361DB9F092</UID>
<Organizer_Name
xmlns="Calendar:">pohly-activesync</Organizer_Name>
<Organizer_Email
xmlns="Calendar:">pohly-activesync@syncevolution.org</Organizer_Email>
<Location xmlns="Calendar:"/>
<EndTime xmlns="Calendar:">20060406T220000Z</EndTime>
(process:5572:0xbbbe9c0): libeas-DEBUG:process timezone
xP///ygAVQBUAEMAKwAwADEAOgAwADAAKQAgAEEAbQBzAHQAZQByAGQAYQBtACwAIABCAGUAcgBsAGkAbgAsACAAQgAAAAoAAAAFAAMAAAAAAAAAAAAAACgAVQBUAEMAKwAwADEAOgAwADAAKQAgAEEAbQBzAHQAZQByAGQAYQBtACwAIABCA
GUAcgBsAGkAbgAsACAAQgAAAAMAAAAFAAIAAAAAAAAAxP///w== => bias -60, standard bias 0,
daylight bias -60, standard '(UTC+01:00) Amsterdam, Berlin, B', daylight
'(UTC+01:00) Amsterdam, Berlin, B'
This is converted correctly into:
DTSTART;VALUE=DATE:20060406
SUMMARY:all day event Berlin
DTEND;VALUE=DATE:20060407
So the conversion of all day times based on the time zone is necessary
here, but breaks the event quoted earlier. The only heuristic that I can
think of is to use the conversion only if the results align with
midnight.
--
Best Regards, Patrick Ohly
The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.