Time Conversion

Updated the time conversion function to work a bit better, and be much
easier to read.