<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMedia",
  "identifier" : "/documentation/CoreMedia/CMTimeGetSeconds(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Media"
    ],
    "preciseIdentifier" : "c:@F@CMTimeGetSeconds"
  },
  "title" : "CMTimeGetSeconds(_:)"
}
-->

# CMTimeGetSeconds(_:)

Returns a representation of the time in seconds.

```
func CMTimeGetSeconds(_ time: CMTime) -> Float64
```

## Parameters

`time`

A time value for which to retrieve seconds.

## Return Value

The time in seconds.

## Discussion

If the time is [`invalid`](/documentation/CoreMedia/CMTime/invalid) or [`indefinite`](/documentation/CoreMedia/CMTime/indefinite), the result is <doc://com.apple.documentation/documentation/Swift/Double/nan>.

If the time is infinite, the result is positive or negative infinity.

If the time is numeric, it ignores the epoch, and returns the result of `time.value / time.timescale`. It performs the division in `Float64`, so the fraction isn’t lost in the returned result.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)