Fix invalid timestamps crashing on Windows