2 Antworten

other alternate would be to build a custom apex class which accepts the dateTime and a decimal as input and then does a break down of the decimal into two parts, first and integer and use the datetime.AddDays (); static DateTime addDecimalDays(DateTime dateTime, Decimal decimalDays){}
so
Datetime newDateTime = DateTime.AddDays(Integer.valueOf(decimalDays));
and then with the decimal component break it out to a number of hours and use dateTime.addhours();
RegardsAndrewp.s. code provide uncompiled and as-isDecimal decimalDayComponent = decimalDays - Integer.valueOf(decimalDays);
Integer roundedHours = Integer.valueOf(decimalDayComponent *24);
newDateTime = DateTime.AddHours(roundedHours);
return newDateTime;