Skip to content
AF
HealthKit reference

timeInDaylight: HealthKit quantity type

HKQuantityTypeIdentifierTimeInDaylight · read from Apple’s documentation on 2026-10-02

HKQuantityTypeIdentifier.timeInDaylight (Objective-C HKQuantityTypeIdentifierTimeInDaylight) is a HealthKit quantity type in Apple's "UV exposure" group. Apple's abstract: “A quantity sample type that measures amount of time the user spent in daylight.” Apple's discussion says its samples use time units and measure cumulative values, so in HKStatisticsQuery it takes .cumulativeSum. It is available from iOS 17.0 and watchOS 10.0.

What Apple says timeInDaylight is

A quantity sample type that measures amount of time the user spent in daylight.

Apple’s abstract, quoted from its timeInDaylight reference page, read 2026-10-02. Apple’s discussion of the type runs 15 words.

Swift
HKQuantityTypeIdentifier.timeInDaylight
Objective-C
HKQuantityTypeIdentifierTimeInDaylight
Family
HKQuantityTypeIdentifier
Apple's topic group
UV exposure

Availability

The versions Apple’s documentation data gives for timeInDaylight, platform by platform, as read on 2026-10-02.

PlatformIntroducedDeprecated
iOS17.0—
iPadOS17.0—
Mac Catalyst17.0—
macOS14.0—
visionOS1.0—
watchOS10.0—

The rest of that release: HealthKit Types Introduced in iOS 17.

Sum or average, and in which units

Apple states both of these in the prose of the type’s discussion, not as properties, so they are derived from Apple’s sentence and the sentence is shown with each.

Aggregation style

cumulative — in an HKStatisticsQuery, use .cumulativeSum. Apple’s sentence:

These samples use time units (described in ) and measure cumulative values (described in ).

Unit family

time — every type in this family is on the HKUnit reference.

Apple states it in the same sentence as the aggregation style, quoted above.

Empty parentheses and a dangling “described in” mark links in Apple’s sentence to other documentation pages: the generator keeps the sentence’s text, not its links, and the quote is left as stored rather than repaired.

Can apps write timeInDaylight?

Apple’s documentation for timeInDaylight does not state that its samples are read-only. Apple states read-only status only in prose, and its silence is not a statement either way, so this page makes no claim that apps can save it.

On Android Health Connect

No verified Health Connect counterpart. The cross-platform matrix pairs only metrics checked against both Apple’s and Google’s documentation, and timeInDaylight is not among them. A similarly named Health Connect record may exist, but a name match is not a verified mapping.

Questions

Should I sum or average timeInDaylight in HealthKit?
Sum it. Apple's documentation for timeInDaylight describes it as measuring cumulative values, so an HKStatisticsQuery over it takes .cumulativeSum. Apple's sentence, as read on 2026-10-02: "These samples use time units (described in ) and measure cumulative values (described in )."
Which unit family does Apple give timeInDaylight?
Time. Apple's discussion of timeInDaylight says its samples use time units: "These samples use time units (described in ) and measure cumulative values (described in )."
Which iOS version added timeInDaylight?
iOS 17.0. Apple's availability data for timeInDaylight lists iOS 17.0, iPadOS 17.0, Mac Catalyst 17.0, macOS 14.0, visionOS 1.0 and watchOS 10.0.

Sources checked

Apple’s abstract and sentences are quoted for identification; the page layout, the capsule and the cross-platform pairing are AIFitnessAPI’s. Generated from Apple’s documentation by scripts/fetch-healthkit-identifiers.mjs, not typed by hand — the same data as the full identifier table.

← All HealthKit type identifiers · Environment, hearing and diving