3.1.4.4.1.2 Interpreting Relative 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 relative date by splitting the value into four values. The 2 most significant bits represent the modifier, the next 3 most significant bits represent the unit, the next 6 most significant bits represent the offset, and the 4 least significant bits represent the tag. These values are interpreted according to the following table.
Value |
Meaning |
---|---|
Modifier |
Specifies whether a relative date is early or late on the given day. If set to 00, there is no modifier. If set to 01, the modifier is "early". If set to 10, the modifier is "late". |
Unit |
Specifies the time unit used by the date. The possible values are 000 (Day), 001 (Week), 010 (Month), 011 (Year), 100 (Week of Month), and 101 (Day of Week). |
Offset |
Specifies the offset from the current date with respect to the unit specified in the unit value. This value MUST be interpreted as a signed value. Possible values are from -32 to 31. |
Tag |
The meaning of this value depends on the unit value. If the unit value is 100, the value of the tag indicates the month. If the unit is 101, the value of the tag indicates the day. |
When the value of unit is 100, indicating "Week of Month", the value of the tag specifies the month. When the value of unit is 101, indicating "Day of Week", the value of the tag specifies the day, as specified in the following table.
Value of Tag |
Meaning |
---|---|
0000 |
Sunday |
0001 |
Monday |
0010 |
Tuesday |
0011 |
Wednesday |
0100 |
Thursday |
0101 |
Friday |
0110 |
Saturday |
The client SHOULD generate a date that reflects the next available date and time that matches the relative date based on the sent date and time of the Message object. For example, if the interpreted value is "next Wednesday" and the Message object was sent on August 16, 2012 (a Thursday), then a possible explicit date value would be August 22, 2012. The exact algorithm for determining a best match is implementation-specific.