Some recent work showed coverage of use of the Interval data type could be better, and indicating time() as a simpler alternative for altering the hh:mm:ss of Date-type data.
A really useful, and hitherto undocumented, aspect of setting Interval data is that inputs, e.g. to interval(), over normal size are automatically re-parsed to normal time element. So an input of "90:70" (90m, 70s) is converted to
“01:31:10”` (1hr, 31m, 10s). The time() operator does the same with inputs. This makes it easier to work with calculated durations in a single unit without having to process them to normal time using before working with interval() or time().
Although setting an Interval type attribute/variable should work is passed a bare string, enclosing it in an interval() call is recommended. So:
$MyInterval = interval("05:30"); // recommended
$MyInterval = "05:30"; // should work, via auto-coercion of data type
Altered pages (now live on the site):
- Interval-Type Attributes.
- interval(dataStr).
- time(aDate, hoursNum, minutesNum[, secondsNum]).
- Date.hour().
- Date.minute().
- Date.second().
The zip of the source TBX has also been updated.