Integrated Nicolas solution for timestamps. Perfected the error handling around timestamps. Refactor.