eligrey/pmxdr — pull request #6 by fidian (2013-04-08 21:49:13+00:00)
Title: Fixing caching header to be maximum date allowed on XP

Below is the commit message. Upon rereading it I realize that I'm too much of a geek at times.

----

It turns out that IE8 on Windows XP (a 32-bit operating system) internally must store dates in the same way that MS-DOS file timestamps are stored. It uses 16 bits for a date and 16 bits for a time, and it starts the clock at 1980-01-01 00:00:00 (no time zone information) and ends at 2107-12-31 23:59:58. The seconds may seem odd, but MS-DOS drops the resolution of the seconds down to just even numbers in order to squeeze it into 16 bits.

Here's a bitwise breakdown for more information:

FEDC BA98 7654 3210 FEDC BA98 7654 3210
YYYY YYYM MMMD DDDD HHHH Hmmm mmmS SSSS

You will get the possible maximums as:
Y (year): 127
M (month): 16
D (day): 31
H (hour): 31
m (minute): 63
S (seconds / 2): 31

So, because S can only go up to 31, only even numbers of seconds are stored, giving you a granularity down to a 2 second margin.