3.1.4.4.1.1 Interpreting Precise Dates

Clients interpret the 15 least significant bits of the integer value generated in step 2 of the procedure specified in section 3.1.4.4.1 as a precise date according to the following procedure.

  1. The value is split into two values. The 3 most significant bits represent the type, and the 12 least significant bits represent the value.

  2. If the type bits are set to 110, the value bits represent a month and year. The 7 most significant bits of the value are converted to a decimal value, which represents the two-digit year. The next 4 most significant bits of the value are converted to a decimal value, which represents the month. The least significant bit is ignored.

  3. If the type bits are set to 100, the value bits represent a year. The 7 most significant bits of the value are converted to a decimal value, which represents the two-digit year. The 5 least significant bits are ignored.

  4. If the type bits are set to 011, the value bits represent a month and day. The 4 most significant bits of the value are converted to a decimal value, which represents the month. The next 5 most significant bits of the value are converted to a decimal value, which represents the day of the month. The 3 least significant bits are ignored.

  5. If the type bits are set to 010, the value bits represent a month. The 4 most significant bits of the value are converted to a decimal value, which represents the month. The 8 least significant bits are ignored.

  6. If the type bits are set to 001, the value bits represent a day. The 4 most significant bits of the value are ignored. The next 5 most significant bits of the value are converted to a decimal value, which represents the day of the month. The 3 least significant bits are ignored.

Year values are encoded as two-digit values. Because of this, values greater than or equal to 50 are added to 1900 to determine the year. Values less than 50 are added to 2000.

Finally, the client SHOULD fill in the missing portions of the date so that the date reflects the next available date and time that matches the specified portions of the date based on the sent date and time of the Message object. For example, if the interpreted value is "January 23" and the Message object was sent on January 20, 2012, then a possible explicit date value would be January 23, 2012. The exact algorithm for determining a "best match" is implementation-specific.