new method getTime modification to implement the string and show pm or am hour