server program timespanSample for form dummy { var a = dtl.New(1605, 11, 05, 6, 45, 32, 43); var b = dtl.New(1914, 7, 28, 5, 42, 21, 10); var c = dtu.New(1605, 11, 05, 6, 45, 32, 43); var d = dtu.New(1914, 7, 28, 5, 42, 21, 10); // more than one way to create a timespan type value trace (b - a); trace (a - b); trace (d - c); trace (c - d); trace timespan.New(4, 3, 2, 1, 60); trace "This timespan is a negative value, but not with the passed-in parameters", timespan.New(-6, 5, 4, 3, 2); trace "For a negative timespan with the passed-in parameters, make all of them negative", timespan.New(-6, -5, -4, -3, -2); /* dtl and dtu type values aren't compatible var j = (b - c); trace j; */ // the timespan data type has individually accessible fields trace timespan.New(4, 3, 2, 1, 60).Days; trace timespan.New(4, 3, 2, 1, 60).Hours; trace timespan.New(4, 3, 2, 1, 60).Minutes; trace timespan.New(4, 3, 2, 1, 60).Seconds; trace timespan.New(4, 3, 2, 1, 60).Milliseconds; // the Total... methods express a timespan type value // in various time units trace (b - a).TotalDays; trace (b - a).TotalHours; trace (b - a).TotalMinutes; trace (b - a).TotalSeconds; trace (b - a).TotalMilliseconds; }