Fix parameters order for EntityFunctions.DiffXXXX, add support of DiffMilliseconds/Microseconds/Nanoseconds