Exactly as you put it:
Code:
The specified time is invalid.



With:
$Date1 = "2006-10-10 20:06:22"
$Date2 = "2006-10-10 20:06:23"

fnDateDiff($Date1, $Date2, "d") ?
Code:
1,15740740740741E-005



...at least a warning in the header comments?