Added support to format the time in the format needed by REST api