Bingo! Someone decided to store timestamps in float64 which has 52 bit mantissa, and the time functions break when losing precision.