Added simple time conversion function