off by one error in the example (december is 11 for localtime!)

You see rjbs, this is why we use DateTime not localtime.