more robust handling of milliseconds