Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 16, 2025

Implements the ability to modify the creation date metadata of photos and videos after they've been saved to the gallery.

Changes

Dart API

  • Added updateDateTaken(entity, dateTime) to DarwinEditor and AndroidEditor
  • Returns updated AssetEntity with new createDateSecond or throws StateError on failure

iOS/macOS (darwin/)

  • Implemented via PHAssetChangeRequest.creationDate property
  • Uses performChangesAndWait with proper validation of edit permissions

Android (android/)

  • Updates MediaStore.MediaColumns.DATE_TAKEN field
  • Requires API 29+; returns false on older versions
  • Timestamp converted from seconds to milliseconds for MediaStore

Usage

// Platform-specific
final newDate = DateTime(2023, 1, 15, 10, 30);
final updatedAsset = await PhotoManager().editor.darwin.updateDateTaken(
  entity: asset,
  dateTime: newDate,
);

// Or for Android
final updatedAsset = await PhotoManager().editor.android.updateDateTaken(
  entity: asset,
  dateTime: newDate,
);

Platform Support

  • iOS 8+ / macOS 10.11+: ✅
  • Android Q+ (API 29+): ✅
  • Android P- (API 28-): ❌ (returns false)
Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature request] Support modifying the creation time of pictures or videos</issue_title>
<issue_description>### Platforms

iOS, macOS

Description

Can iOS and macOS support modifying the creation time of pictures or videos?

Why

No response

Additional

Better support modifications on Android, too.</issue_description>

Comments on the Issue (you are @copilot in this section)

@CaiJingLong Looking at the [documentation][doc] , it should be possible.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add support for modifying creation time of pictures and videos Add updateDateTaken method to modify asset creation time on iOS, macOS, and Android Nov 16, 2025
Copilot AI requested a review from AlexV525 November 16, 2025 04:21
Copilot finished work on behalf of AlexV525 November 16, 2025 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature request] Support modifying the creation time of pictures or videos

2 participants