Get the TimeSlider date. The timeExtent value you choose depends on the mode.
var timeSliderDate = timeSlider.timeExtent.endDate || timeSlider.timeExtent.startDate;
Clone the date and zero out the time components:
var baseDate = new Date(timeSliderDate.valueOf());
baseDate.setUTCMilliseconds(0);
baseDate.setUTCSeconds(0);
baseDate.setUTCMinutes(0);
baseDate.setUTCHours(0);
Get the number of hours between the two date objects:
var milliseconds = timeSliderDate.valueOf() - baseDate.valueOf();
var seconds = milliseconds / 1000;
var minutes = seconds / 60;
var hours = minutes / 60;
Set the layer's request parameters:
UM1_CLOUD_WMTSLayer.set("customLayerParameters.TIME", baseDate.toISOString());
UM1_CLOUD_WMTSLayer.set("customLayerParameters.DIM_FORECAST", Math.round(hours));