Fixed the date/time conversion code