I've logged the issue. It does seem to be specific to CurrentDateTime as this does work:

Code:
Function MyCurrentDateTime Global Returns DateTime
    Function_Return  (CurrentDateTime())
End_Function

Procedure Test
    DateTime dtStart
    Integer iMilliSecs
    
    Move (CurrentDateTime()) to dtStart
    Sleep 1
    Move (SpanTotalMilliseconds(MyCurrentDateTime() - dtStart)) to iMilliSecs
    
    Showln iMilliSecs
End_Procedure

Send Test