Scroll

Custom Function: TimeSpan difference between dates

This function returns the difference between two dates as a TimeSpan.

Arguments (Min - Max): 2 - 2

Usage

SpanDateDiff(x, y)

  • x and y are Dates, Times, DateTimes, or date strings

Code

return (Convert.ToDateTime(args[0]) - Convert.ToDateTime(args[1])).Duration();

Hidden Article Information

Article Author
Nick
created 2016-03-04 22:54:33 UTC
updated 2017-06-20 17:07:08 UTC

Labels
functions, example, custom function, DateTime,
Have more questions? Submit a request