Since upgrading server to ND6, I am getting an “Illegal function call” error on a scheduled agent. I have narrowed it down to the following line of code:
A string expression that represents a valid date/time, or a Variant of DataType 7 (Date/Time). It can use either 12-hour or 24-hour format; for example, both “14:35” and “2:35PM” are valid. If you omit the seconds value in the stringExpr argument, it defaults to zero (0).
I would suspect that since elapsed is not a date/time value (it only represents the number of seconds elapsed), TimeValue is throwing an error.
I created a test agent with same code and this is the value I get for elapse
1.15740767796524E-05
which to the best of my knowledge is not a valid date/Time value. In R5, since this is not a valid date/time error, timevalue(invaliddatetime) returns 12:00:00 AM.
This is clearly a case where R6 is definitely correct, but its correctness is causing older code to break.