[horde] Wrong Birthday entry in Contacts ActiveSync & Andoird ICS 4.0.2

Michael J Rubinsky mrubinsk at horde.org
Thu Mar 1 17:07:26 UTC 2012

Quoting Daniel Basa <daniel at luli.de>:

> Am 01.03.2012 16:49, schrieb Michael J Rubinsky:
>> Quoting Daniel Basa <daniel at luli.de>:
>>> Am 01.03.2012 15:57, schrieb Michael J Rubinsky:
>>>> Quoting Daniel Basa <daniel at luli.de>:
>>>>> Hi List!
>>>>> back again with an ActiveSync Android problem. This time I think that
>>>>> it's not a problem with horde, but I would like to know if someone is
>>>>> experiencing the same issue.
>>>>> Since January I sync my Contacts and my Calendars using Horde. The
>>>>> first
>>>>> two months I also had the google contact on my phone, but I did a whipe
>>>>> today and resynced with horde.
>>>>> Problem is, that all contact's birthday dates are wrong by one (or
>>>>> two?)
>>>>> days. They are correct in horde's addressbook and I checked the sync
>>>>> log
>>>>> and noticed birthdays of contacts in there were correct too.
>>>>> Question is
>>>>> why are the birthdays on my phone wrong?
>>>>> Anybody has the same issue? Perhaps a bug with google? Because of leap
>>>>> year?
>>>> Earlier Android "Contact" apps did not even support birthdays and would
>>>> display them exactly as sent i.e., as the standard date/time string in
>>>> UTC. The app in ICS, though, does have support for the birthday field
>>>> and is working for on my Galaxy Nexus device.
>>>> If you generate a sync log that includes the contact data being sent to
>>>> the device, I can try to take a look and see if anything weird pops out.
>>>> Also, does the timezone on the device match the timezone in your Horde
>>>> account prefs? Just grasping at straws though since it shouldn't really
>>>> matter; I don't see how tz can matter since tz data is not sent as part
>>>> of the protocol for contact messages.
>>>> Anyway, see http://wiki.horde.org/ActiveSync for more information on how
>>>> to debug, provide log files etc...
>>> Sorry for that! While removing sensible data from the log files I
>>> recognized, that the birthday data is already wrong in the log file. I
>>> must have made a mistake last time I checked the birthday. So the data
>>> is defintly somehow changed by horde. Re checking the horde interface
>>> shows that the data inside horde's gui is correct. The data inside the
>>> mysql database is correct too (Table: turba_objects). I am running
>>> Address Book (turba) 3.0.11, Horde Groupware Webmail Edition 4.0.6
>> AFAIK, all date/time data is supposed to be transmitted as UTC time, so
>> it will be different than what Horde displays in the GUI, unless your
>> timezone *is* UTC.  When I get back to my office, I will double check
>> the specs to be sure that the birthday field, specifically, is supposed
>> to be transmitted as such.  Though, I wonder why it works for me, on an
>> ICS device, in a non-UTC timezone.
>> Do you store your calendar data in the database in UTC, or as floating?
> Calendar data is stored in UTC (kronolith). I am in UTC+1. But time
> should not have an impact on a date, right?!

Sure it does. A birthday is entered as 3/1/1970. There is not time  
associated with it in Horde's datastore but the data format required  
to be sent to the device does require a time. So, we turn that into  
12:00am on 3/1/1970. This is in YOUR tz UTC+1. So when the ActiveSync  
code prepares to send the message to the device, it is converted to  
2/28/1970 11:00pm (or maybe 2/29 - don't know if 1970 was a leap year  
or not). The device is supposed to be smart enough to change it back  
to the timezone of the device, in your case also UTC+1, so the  
birthdate *should* once again become 12:00am 3/1/1970.

> Or maybe?
> Bday data in horde is stored as varchar but in date format yyyy-mm-dd.
> There is no time associated with the bday ... at least as far as i can see.
> Well in the log on the other hand a bday entry looks loke this
> yyyy-mm-ddT23:00:00.000Z. If this is UTC and I am in UTC+1 than this
> could probably have an impact, but it would mean +1 day and the contacts
> on my phone have at least -1 day.

No, see explanation above. If it is stored in the database as  
1970-03-01, it is sent as 1970-02-28 11pm UTC the device, if in UTC+1  
*should* add the hour back to the datetime to get the correct  
birthdate. It sounds like either this part is not happening, or the  
device considers 12:00am to belong to the previous day, and not the  
current day. I will have to dig into the specs a bit to make sure I am  
not making incorrect assumptions about the data required by the  
birthday field.


The Horde Project (www.horde.org)
mrubinsk at horde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-keys
Size: 2200 bytes
Desc: PGP Public Key
URL: <http://lists.horde.org/archives/horde/attachments/20120301/6bde45bd/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6096 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.horde.org/archives/horde/attachments/20120301/6bde45bd/attachment-0003.bin>

More information about the horde mailing list