Do you see what is wrong with this code?
If you run the code, you'll see that gs.dateDiff() returns the same value for the difference between date1/date2 and date1/date3 even though there is a 10 minute difference. Why is it rounding to the full number of days?
Well, it turns out that the default string conversion is not what gs.dateDiff() is expecting. Instead, it is expecting the date/time string in the user's display format.
(so if your default date / timeformat matches the internal, then you'd actually get the correct results and wonder what I'm complaining about.)
Instead of just failing, gs.dateDiff() seems to do the math where it can (e.g. the difference in days). This seems a poor choice in that you are giving the impression of valid results when the results are not accurate.
What you need to do to make sure you get the correct results is the following:
getDisplayValue() converts the internal date format to the one expected in the execution context.