Much better way of doing TimeToString

The old way was a right mess.