Found this while trying to fix something else. If time_t is treated as signed (32-bit Linux) and you have a time_t value where the high bit is set then when you convert it to 64-bit you get an improperly sign-extended value. See the included test for an example (make sure you run the 32-bit tests).
Best, Erich