How to get differences UTC datetime

Hello all,
I’m learning to make Sales Order report. I get in trouble when calculating lead time between CustPackingSlipJour.createdatetime and WmsPickingRoute.createdatetime
I’m counting the old days between the posting and the posting pickinglist packingslip

I created the following code

display str totdays()

CustPackingSlipJour CustPackingSlipJour;
wmspickingroute wmspickingroute;

select CustPackingSlipJour
where CustPackingSlipJour.SalesId == salestable.SalesId ;

select wmspickingroute
where wmspickingroute.transRefId == salestable.SalesId ;

return (strfmt("%1",(DateTimeUtil::getDifference(custpackingslipjour.createdDateTime,wmspickingroute.createdDateTime)))) ;


please help me…