HoursPart
The hours component of a duration: (duration mod 1440) / 60. Preserves the
duration’s sign.
Category: Time Returns: int
Signature
HoursPart(duration)
The argument is a duration in minutes, typically the result of another time function or a subtraction between two of them.
Examples
HoursPart(125) // 2 (two hours, five minutes)
HoursPart(FromDays(1) + FromHours(3)) // 3, the day component drops out
HoursPart(-125) // -2, sign preserved
Notes
- Requires time to be enabled for the project (Project, then Time). With time disabled, any expression using this function fails validation.
- Drops whole days before extracting hours: a duration of exactly one day
plus three hours yields
3, not the day count folded in. - Pairs with MinutesPart and DaysPart to decompose a duration into a “D days, H hours, M minutes” display.