<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PhotoKit",
  "identifier" : "/documentation/Photos/PHLivePhotoFrame/time",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Photos"
    ],
    "preciseIdentifier" : "c:objc(pl)PHLivePhotoFrame(py)time"
  },
  "title" : "time"
}
-->

# time

The time offset, in seconds, of this frame relative to the start of the Live Photo.

```
var time: CMTime { get }
```

## Discussion

You can use this value to vary your image processing over time, creating animated effects. For example, the following code sets up an animated filter that fades from sepia tone to original to sepia tone again over the duration of the Live Photo:

```objc
// Save properties of the context to avoid capturing it in the block.
NSTimeInterval duration = CMTimeGetSeconds(context.duration);
NSTimeInterval photoTime = CMTimeGetSeconds(context.photoTime);
// Frame processor block uses duration/photoTime/frameTime to animate.
context.frameProcessor = ^CIImage *(id <PHLivePhotoFrame> frame, NSError **error) {
    NSTimeInterval frameTime = CMTimeGetSeconds(frame.time);
    NSTimeInterval intensity;
    if (frameTime < photoTime) {
        // Vary intensity from -1.0 to 0.0 before the photo.
        intensity = -frameTime / photoTime;
    } else {
        // Vary intensity from 0.0 to 1.0 after the photo.
        intensity = (frameTime - photoTime) / (duration - photoTime);
    }
    return [frame.image imageByApplyingFilter:@"CISepiaTone"
                          withInputParameters:@{ kCIInputIntensityKey: @(intensity) }];
};
```

---

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)