© serviceprofessionalgmbh

Return value is the number of days which lie between two given dates. Both dates are expected in the format tt.mm.jjjj.

/* REXX
*/
parse source . PTYP .
if PTYP = "FUNCTION" then arg DAT1,DAT2,DUMMY
else                      arg DAT1 DAT2 .
DAT1 = date("B",right(DAT1,4) !! substr(DAT1,4,2) !! left(DAT1,2),"S")
DAT2 = date("B",right(DAT2,4) !! substr(DAT2,4,2) !! left(DAT2,2),"S")
if DAT1 > DAT2 then do /* DAT1 muss <= DAT2 sein */
   DAT1 = bitxor(DAT1,DAT2)
   DAT2 = bitxor(DAT2,DAT1)
   DAT1 = bitxor(DAT1,DAT2)
end
return DAT2 - DAT1
back to Date & Time