[tt]
Hello,
I have been spending two working days on reverse-engineering TrueSync desktop in order to solve the 2006-ToDo-Problem.
It is possible to change the highest end-date in order to add entries with a date after 2005-12-31. Now I can choose dates like 2006-01-30. This is good news.
However, TrueSync Desktop itself has a _very_ weird internal date format for ToDo entries, which actually is different from the internal date format for Call entries.
The _very_ weird internal date format format is as follows:
It is a 32 bit number composed of following bits (MSB to LSB):
1y0ddddd 1yyymmmm 10000000 10000000
where
yyyy are 4 bits denoting the years from the year 1990
mmmm are 4 bits denoting the months from the start of the year
ddddd are 5 bits denoting the days from the start of the month
Months start with zero, so mmmm=0 means January, mmmm=1 means February, mmmm=2 means March ....
so the date 2004-06-29 is encoded as
yyyy=14 (14 years from 1990)
mmmm= 5 (5 months from the start of the year)
ddddd=29
As you can see, the bit #3 of the year number (call it "y3") is already "displaced" (it is not neighbouring to the ohther year-bits).
The internal date calculation is as follows:
The "Microdate"-software-component (sitting in "micrdate.dll") returns an ordinary UNIX-time to TrueSync Desktop (this is a time measured in seconds since 1970-01-01 00:00:00 UTC).
This ordinary UNIX-time is broken up into (year,month,day of month,hour,minute,second). However, year is measured here as years from year 1900. So year 2007 is represented as number 107. TrueSync desktop takes this year and subtracts 90 from it to create year2 (year2 is an 8-bit-value). So for year 2007, it calculates year2 = 107-90 = 17. For year 1994, it calculates year2 = 94-90 = 4. For year 1989, it calulates year2 = 89-90 = 255. (!) (This is unsigned 8-bit-subtraction, so negative values "wrap around").
Then TrueSync Desktop compares this value (year2) wether it is greater than 7. If year2>7 (this is true for years from 1980 inclusie to 1990 exclusive and for years from 1998 on), the bit y3 is set to 1, otherwise it is set to 0. The other bits y2y1y0 are set to the lowest 3 bits of year2, the highest 5 bits of year2 are silently dropped.
So
for year 2004, yyyy = 0b1110 = 14 meaning year 2004
for year 2007, yyyy = 0b1001 = 9 meaning year 1999
for year 1994, yyyy = 0b0100 = 4 meaning year 1994
for year 1989, yyyy = 0b1111 = 15 meaning year 2005
This fully explains the odd behaviour when selecting different years on the ToDo entry dialog, resulting in other years than intended.
However, this also makes things more problematic. Unlike in many other date formats, the date format
1y0ddddd 1yyymmmm 10000000 10000000
has no obvious place where to store additional year information. Whoever created this particular part of TrueSync Desktop or Sidekick (this very weird and inusable date format) must have been very very stupid and inexperienced. :-(
Maybe the '0' in "1y0ddddd" can be set to 1 do represent dates beyond year 2005, but this is unkown.
Interestingly, the Call entry list (the listing of whom to be called up to which limit time) below the ToDo entry list uses a different date format, which basically is as follows
10000000 1yyyyyyy 1mmmmmmm 1ddddddd
where
yyyyyyy is the number of years since year 1900
The Call entry date format is actually a bit different (I have not found it out yet, as the Call date format was not my objective), but what counts: it leaves enough room for additional days beyond 2006 (namely up to year 2027).
It is notable that actually there are two different date formats for no apparent reason. Maybe different software developers worked on different parts of SideKick|TrueSync Desktop. It may also be that these measures were taken to obfuscate the data format - to make it difficult to create compatible software. I do not know. Using two different date formats in the same software application als also very stupid (as this increases costs and bugs and interoperability problems).
To summarize: there is not much hope that any ToDo list entry can have a year 2006 or greater as part of its expiry date. (However, if any user manages to create such a ToDo list entry, please write me.)
But there is hope that one can use the Call entry list to simulate ToDo entries, including expiration of entries and so on.
If anybody wants these investigations to be pushed further, please contact me (I also like to work for money ;-)). If anybody wants to use these investigations and wants to credit me, then please credit the pseudonym "kWkW".
So far,
kWkW.
[/tt]