---
title: "itemTime(forHostTime:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avplayeritemoutput/itemtime(forhosttime:)"
---

# itemTime(forHostTime:)

Converts a host time, specified in seconds, to the item’s timebase.

## Declaration

```swift
func itemTime(forHostTime hostTimeInSeconds: CFTimeInterval) -> CMTime
```

## Parameters

- `hostTimeInSeconds`: A host time value, specified in seconds. For example, you might specify the time value returned by the doc://com.apple.documentation/documentation/QuartzCore/CACurrentMediaTime() function or the timestamp from a doc://com.apple.documentation/documentation/QuartzCore/CADisplayLink object for this parameter.

## Return Value

Return Value The equivalent time in the item’s timebase.

## Discussion

Discussion The timestamp associated with a CADisplayLink object represents the time of the most recent screen refresh, which is usually a time in the past. If you want to find the time associated with the next screen refresh, you need to increment the timestamp by the value in the display link’s duration property.

## See Also

### Time conversion

- [itemTime(forMachAbsoluteTime:)](avfoundation/avplayeritemoutput/itemtime(formachabsolutetime:).md)
- [itemTime(for:)](avfoundation/avplayeritemoutput/itemtime(for:).md)
