Calligra Sheets HOUR Function: Extract the Hour from a Time
Learn Calligra Sheets HOUR with 26.08.2 source checks, optional-time syntax, step-by-step examples, error behavior and Excel differences.
Verification status: Consult the documentation and examples below. Native application testing has not been documented for this guide. How formula examples are checked
Quick answer: what HOUR does
HOUR extracts the hour component (0–23) of a time. For a real typed time 14:35:42, =HOUR(TIME(14;35;42)) has expected result 14. This is useful when building a scheduling, reporting or time-quality-check worksheet. It does not return a full time or elapsed duration. The source also registers HOURS with the same implementation callback; HOURS is covered here as a synonym rather than a separate calculation.
Version, scope and validation: This guide is based on KDE’s handbook and Calligra 26.08.2 source (KDE release dated October 8, 2026; sources checked October 12, 2026). The pinned source comes from commit 72123cc643f6625351139e7df294544255a1056f. The source and handbook establish registrations and intended behavior for that code snapshot, not a guarantee for every binary, platform, installation or imported file. Calligra Sheets was not run in this research. Every worksheet number labeled expected is independently calculated or drawn from a documented KDE example; none is a screenshot or result observed in a native build.
Exact syntax, argument order, data type and defaults
=HOUR(time)
=HOUR()
=HOURS(time)
time— optional, first and only argument. KDE’s English-language handbook describes the time argument as Text; the compiled function registration permits zero or one argument (setParamCount(0, 1)), and the callback passes a supplied value through Calligra’sasTime()converter. That allows a typed time value as well as documented accepted time expressions, but does not prove that every user-entered string will parse in every locale.- Omitted argument:
=HOUR()takes the current local time, then returns its hour component. It has no fixed default time. Its output changes with the clock and evaluation; do not hardcode an expected number for an unrecorded test run. - Return type: KDE calls this a whole number; the pinned callback returns an integer
Value. The conceptual hour component is 0–23 for ordinary nonnegative clock times. - Argument order: with one argument, supply a single time expression or cell reference. It does not take separate hours, minutes, seconds. If you have separate components, construct a time first using
TIME(hours;minutes;seconds).
Regional settings: Formulas in the KDE English handbook use ; between multiple parameters (as in TIME(14;35;42)). An installed spreadsheet might show a different separator, different 12/24-hour display, localized time literals or comma decimal separators. Check your local formula editor. For reusable examples, use TIME() with numeric arguments rather than assuming that the literal text "02:03:04" parses identically everywhere. Do not mistake a visually formatted date/time string for a typed spreadsheet time.
Reproducible six-row worksheet, with expected results
Open a new Calligra Sheets worksheet. In A1, type Typed time; in B1, type HOUR result. Enter each formula below into column A; enter the corresponding =HOUR(A2)-style formula into column B. Copy B2 down to B7. Format A2:A7 as time (hh:mm:ss) if needed, while leaving B as ordinary numbers.
| Row | Enter in A (formula) | Time represented (reading aid) | In B enter | Expected B (not native-observed) |
|---|---|---|---|---|
| 2 | =TIME(9;8;7) |
09:08:07 | =HOUR(A2) |
9 |
| 3 | =TIME(14;35;42) |
14:35:42 | =HOUR(A3) |
14 |
| 4 | =TIME(0;0;0) |
00:00:00 | =HOUR(A4) |
0 |
| 5 | =TIME(23;59;59) |
23:59:59 | =HOUR(A5) |
23 |
| 6 | =TIME(7;15;30) |
07:15:30 | =HOUR(A6) |
7 |
| 7 | =TIME(16;2;5) |
16:02:05 | =HOUR(A7) |
16 |
How these were checked: TIME(h;m;s) in the examined KDE code creates an internal Time from three numeric components. The HOUR callback extracts its hour property. I independently parsed the six entered h:m:s triplets to obtain the listed expected integers. Native execution: unavailable. The cell’s displayed time could differ with regional formatting, but the canonical 24-hour components are unambiguous for these controlled inputs.
To verify a result yourself, check that A3 represents 14:35:42, select B3 and inspect the formula bar. If B3 disagrees with the independently computed 14, confirm that A3 is a time value, not a string that merely looks like one, and that the installed Calligra version has the same semantics.
A second reproducible check: direct formula, string and serial fraction
The direct nested formula =HOUR(TIME(14;35;42)) → 14. This removes any dependencies on cell formatting or copy/fill operations and is the safest initial calculation to compare across installations.
KDE documents =HOUR("22:10:12") → 22, and =HOUR(0.1285) → 3. The former depends on locale-aware time parsing in a real program; the latter is a documentation example, not a native test in this research.
The documented fractional-day examples should not be confused with an unconditional promise that arbitrary text timestamps, invalid dates or nonstandard input serials have identical behavior in Excel and Calligra. The native parsing and representation of fractional times were not tested.
Practical advanced use
For a shift-start scheduling grid, use =HOUR(A2)*60+MINUTE(A2) to transform a time into minutes since midnight. At 09:08:07 it gives 548. This is clock time, not a duration measure: if an overnight shift ends at 02:00 after starting at 23:00, subtracting extracted hours naïvely gives a negative number. Use true date/time values and an overnight rule instead of relying on HOUR alone.
Second independent calculation: =HOUR(A3)*60+MINUTE(A3) is expected to return 875 minutes since midnight for 14:35:42. The seconds are intentionally ignored. This calculation is based on the same typed times used above, without asserting that the formula ran in a native Calligra installation. If time is imported as text, explicitly parse or enter it as time before applying the extraction function, and verify the result in the target locale.
For complete duration arithmetic, work with full timestamps and appropriate formatting rather than extracting the hour component and assuming it reflects elapsed time. Time zones and daylight-saving adjustments belong in timestamp handling, not in these component functions.
Source-specific edge cases, errors and limitations
The callback returns time.hours() % 24. Its own source contains a FIXME about legacy QTime hour handling. Treat durations beyond 24 hours as a native-validation question, not proof that an elapsed-duration hour total is preserved.
- Missing value versus omitted argument:
=HOUR()has intentional current-clock semantics;=HOUR(A8)when A8 is blank presents an explicit reference, and its conversion behavior is a separate question. Do not infer the latter from the former. The actual blank-cell result requires native validation. - Invalid or non-localized text:
HOUR(NA())reaches theasTimeconversion and the callback returns a conversion error if conversion reports one; the exact displayed error depends on native evaluation and is not asserted here. The return code and text displayed in the user interface are not verified here. - Stored number versus visible time: A cell can look like
14:35:42while containing a text label. Inspect the formula bar and useTIME()to distinguish display formatting from conversion. Values outside ordinary clock ranges may be normalized by the input-conversion routines or rejected; avoid unverified assumptions. - Alias and file interchange: The source registers
HOURSto the same callback. When exporting to another spreadsheet application, the plural name may not be supported as a function there. The canonical singular name is preferable for portability. - Platform/edition scope: This evidence is pinned to one KDE source release; native Windows/macOS packaging, downstream patches, locales and spreadsheet file conversions have not been separately exercised.
A full date-time can carry a time component, but the precise implicit-conversion behavior of text timestamps and dates varies with parsing settings. A genuine typed time created using TIME is the controlled input.
Cross-software compatibility: documented versus assumed
Calligra 26.08.2: HOUR accepts 0–1 arguments, and HOURS maps to the same implementation (per KDE registration). The callback converts an explicit argument to Time and reads its hour component (per source). Microsoft Excel: Excel uses HOUR(serial_number) and requires serial_number; KDE registers zero or one argument. In Excel, HOUR() without an argument should not be treated as a portable equivalent of Calligra’s no-argument current-hour use. Microsoft documentation is used only to describe Excel, not as proof of Calligra behavior.
What is likely portable: =HOUR(A2) where A2 contains a conventional, properly typed 24-hour time. What is not automatically portable: the no-argument form, the alternate plural name, localized textual inputs, unusual duration values. Check the destination application’s formula separator and time interpretation before trusting a migrated workbook.
Troubleshooting checklist and expected checks
- Unexpected value: Compare against a nested typed-time formula,
=HOUR(TIME(14;35;42))→ 14. If this works but a referenced cell does not, inspect its underlying value or text format. - Formula name not recognized: Check exact spelling
HOURand the target version.HOURSis source-registered in Calligra 26.08.2 but does not mean all spreadsheet products recognize it. - Wrong hour or minute after import: Confirm whether the source uses a 24-hour time, has AM/PM suffixes, and includes a date or time zone. Convert consistently before extracting components.
- Error on a typed string: Compare a literal documented example with
TIME(h;m;s). If only the string fails, suspect locale-aware text parsing. Record the exact application version and observed error. - Unexpected change when revisiting sheet: Avoid the no-argument invocation for fixed historical records: it reads the current clock, not a saved event timestamp.
- Duration exceeds 24 hours: Use an actual duration/timestamp calculation, not a component value. A formatted 26-hour duration is not guaranteed to return a total of 26 hours from HOUR.
- Native source inconsistency: Use a known
TIMEinput and compare with this evidence; report the installed platform, locale, exact formula and observed result to the editor. The native check is pending, not silently presumed successful.
Related, verified reference links
- KDE’s official
HOURhandbook section — documents the purpose, text-labeled parameter, examples and no-argument behavior. Accessed 2026-10-12. - KDE’s
TIMEhandbook section — supplies reproducible numeric time construction. Accessed 2026-10-12. - KDE’s
HOURShandbook entry — distinct heading; same implementation in the pinned release. Accessed 2026-10-12. - Pinned KDE function registrations and pinned time-extraction callback — review source-specific arity, aliases, conversion and error behavior. Verified against pinned commit
72123cc643f6625351139e7df294544255a1056fon 2026-10-12. - Official KDE Calligra release history — lists 26.08.2 dated 2026-10-08. Accessed 2026-10-12.
- Microsoft’s Excel
HOURreference — comparative Excel-specific required argument and range. Accessed 2026-10-12.