This version is out of date, covering development from v8.0.0 to v8.x.x. It is maintained here only for inbound reference links from elsewhere. It is no longer actively updated.

Jump to the current version of aTbRef

Tinderbox v8 Icon

Interval.hour


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator Altered: 

 Property   [other Property type actions]

 Item   [operators of similar scope]

 Date-time   [other Date-time operators]

 Baseline

 


$MyInterval.hour

Returns the Interval expressed as a Number of whole or partial hours within the current day (ignoring whole days). Thus, if $MyInterval is 12 hours 30 minutes then:

$MyNumber = $MyInterval.hour; 

returns 12

Older behaviour

Prior to v8.0.4 it returned not just the hours element of the interval but the entire interval expressed as hours. Thus, 1 day 12 hours and 30 minutes returns 36.5 and not 12.5 or 12.

If $MyInterval is 12 hours 30 minutes then:

$MyNumber = $MyInterval.hour; 

returns 12.5

To get an integer value, i.e. in whole hours, use either Number.precision() or floor(), thus:

$MyNumber = $MyInterval.hour.precision(0);

returns 12

$MyNumber = floor($MyInterval.hour); 

returns 12