Newer Version Available

This content describes an older version of this product. View Latest

getHoursInDuration()

Returns a length of time in hours.

Signature

getHoursInDuration(Duration duration)

Parameters

duration
Type: Duration
The duration object returned by $A.localizationService.duration.

Returns

Type: number
The number of hours in the duration.

Sample Code

1var dur = $A.localizationService.duration(60, 'minute');
2// Returns 1, the number of hours in the given duration
3$A.localizationService.getHoursInDuration(dur);