Adding toFormattedTime method