---
title: "setTime(_:)"
framework: coremedia
role: symbol
role_heading: Instance Method
path: "coremedia/cmtimebase/settime(_:)"
---

# setTime(_:)

Sets the current time.

## Declaration

```swift
func setTime(_ time: CMTime) throws
```

## See Also

### Getting and Setting Time

- [time(withTimescale:rounding:)](coremedia/cmtimebase/time(withtimescale:rounding:).md)
