Fix time handling by passing correct parameters in the rest api call.