Trouble with the date time stamp while importing media

49 views
Skip to first unread message

Katie & Doug Cherry

unread,
Aug 27, 2024, 4:08:55 PM8/27/24
to Subsurface Divelog
I can't seem to sync the media (my pics) with my dives. I should begin with I am not a power user (in fact I'm hanging on my fingernails so please keep the answers in 3rd grade terms). I downloaded the pics from my iphone to my computer. I did notice that the created date was different from the date taken field. After many hours, i figured out with some help from ChatGPT how to get Exiftool and change the created date to match. I verified that the dates were the same and that they fell within my dive window yet when I tried to load media from file, I still got the error message that there was nothing within the dive window (by :30 minutes).Ā  What do I need to do?
Thanks in advance.

Martin Swanston

unread,
Aug 27, 2024, 4:22:18 PM8/27/24
to subsurfac...@googlegroups.com
There is an option on the media window (on the PC) to ignore the date/time being different. Took me a few goes to realise but I don’t worry about the date or time of the media, just import with that checkbox checked.Ā 

On 27 Aug 2024, at 21:08, Katie & Doug Cherry <dache...@gmail.com> wrote:

I can't seem to sync the media (my pics) with my dives. I should begin with I am not a power user (in fact I'm hanging on my fingernails so please keep the answers in 3rd grade terms). I downloaded the pics from my iphone to my computer. I did notice that the created date was different from the date taken field. After many hours, i figured out with some help from ChatGPT how to get Exiftool and change the created date to match. I verified that the dates were the same and that they fell within my dive window yet when I tried to load media from file, I still got the error message that there was nothing within the dive window (by :30 minutes).  What do I need to do?
Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "Subsurface Divelog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to subsurface-dive...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/subsurface-divelog/4619fc4f-5512-4a8c-9a97-b1c7d5cd51e1n%40googlegroups.com.

Dirk Hohndel

unread,
Aug 27, 2024, 10:56:47 PM8/27/24
to Subsurface Divelog
So the by far easiest way to deal with this is to take a picture of your dive computer's time at the beginning of the trip.
And then when you import the pictures, you can use that picture (and the time it appears to from) to calculate the offset.
But even without that, you can simply time shift pictures that you import right there in the import menu.

I do NOT recommend using exiftool to do anything to the pictures (and I do not recommend listening to ChatGPT for... pretty much anything).


/D

On Aug 27, 2024, at 13:08, Katie & Doug Cherry wrote:

I can't seem to sync the media (my pics) with my dives. I should begin with I am not a power user (in fact I'm hanging on my fingernails so please keep the answers in 3rd grade terms). I downloaded the pics from my iphone to my computer. I did notice that the created date was different from the date taken field. After many hours, i figured out with some help from ChatGPT how to get Exiftool and change the created date to match. I verified that the dates were the same and that they fell within my dive window yet when I tried to load media from file, I still got the error message that there was nothing within the dive window (by :30 minutes).Ā  What do I need to do?
Thanks in advance.

Message has been deleted

Katie & Doug Cherry

unread,
Aug 29, 2024, 2:12:45 AM8/29/24
to Subsurface Divelog
Thanks Martin - I did that as a work around and it does get the photos into the dive log but it does not put them in the right time, however it did allow me to put them in the correct dive after I separated them.

Dirk - Why would you not use either of the programs you listed above.Ā  You sound very certain of it but you don't provide any context.Ā  I did take a picture of my dive watch but it didn't and used that option but it still did not work.

All - When I did my last dive trip, I simply downloaded my pics to my laptop and it all went just fine without doing any manipulation. Is this a new problem with the interface between apple (iPhone) and Microsoft?Ā 

Dirk Hohndel

unread,
Aug 29, 2024, 4:13:17 AM8/29/24
to Subsurface Divelog
The reason why I advise against attempts to manually "fix" things with other apps is exactly the result that you got. Very often users don't do the adjustment correctly and as a result the pictures aren't at the right timestamp.

That's fundamentally why we added the time shift feature in the first place.

Anyway, I'll be happy to let someone else try to help you with your problem.

Cheers!

/D

Michael Keller

unread,
Aug 29, 2024, 5:47:06 PM8/29/24
to subsurfac...@googlegroups.com
Hi Katie & Doug.

On Thu, 29 Aug 2024 at 18:12, Katie & Doug Cherry <dache...@gmail.com> wrote:

All - When I did my last dive trip, I simply downloaded my pics to my laptop and it all went just fine without doing any manipulation. Is this a new problem with the interface between apple (iPhone) and Microsoft?Ā 

No, this problem is not new at all. On pretty much all dive computers and consumer level cameras, the facilities to set time / date are fairly lousy, and do not support setting a timezone. Furthermore, the protocols for downloading dives and photos are just as poor, and times are mangled even more based on assumptions around the timezone on the computer used for downloading being the same as the timezone the dive / picture was recorded. So you end up with dives and photos that both may or may not have recorded the correct time and timezone.

This is exactly why the 'take a reference picture' facility was introduced - it cuts out all of the middlemen and aligns the timelines between dive log and photos.Ā 
(Note that this is the same approach as the clapperboard used in movie making (https://en.wikipedia.org/wiki/Clapperboard). And despite a shift to digital for pretty much everything in movie making this device is still in widespread use.)

Ngā mihi
Ā  Michael Keller

--
GCS$/CC/E/IT d- s+ a C++ UL+++/S++ P L++ E-
W++ N o? K? w O(++) M-- V+ PS+ PE+ Y? PGP+ t
5? X R tv b++ DI++ D++ G e+++ h---- r+++ y+++

Katie & Doug Cherry

unread,
Aug 28, 2025, 10:37:15 PMAug 28
to Subsurface Divelog
I have finally solved this. After putting the problem aside for a year, I used ChatGPT and got a great easy solution that fixed all the date problems created when downloading pictures from an iphone to a windows computer; something I discovered is common. I've copied all the Chat GPT instructions here if anyone else is having this problem and wants a step by step fix with all the code written out for them to copy. I even included my follow on questions and the answers for those who are like me and not tech savvy.Ā Ā 

I hope this helps.
On Windows, when you copy photos from your iPhone, the **Date Created** field is often reset to the time of the transfer, while **Date Modified** usually keeps the actual ā€œtakenā€ time. Unfortunately, Windows doesn’t have a built-in way to edit the *Date Created* field directly, but there are reliable workarounds:

---

### āœ… Option 1: Use Windows PowerShell

1. Open **PowerShell** (search for it in the Start menu).
2. Navigate to the folder containing your photos:

Ā  Ā ```powershell
Ā  Ā cd "C:\path\to\your\photos"
Ā  Ā ```
3. Run this command (this will copy the Date Modified value into Date Created for all `.jpg` files in the folder):

Ā  Ā ```powershell
Ā  Ā Get-ChildItem *.jpg | ForEach-Object {
Ā  Ā  Ā  Ā $_.CreationTime = $_.LastWriteTime
Ā  Ā }
Ā  Ā ```

Ā  Ā * `CreationTime` = Date Created
Ā  Ā * `LastWriteTime` = Date Modified

Ā  Ā This will set **Date Created = Date Modified**.

---

### āœ… Option 2: Use a Free Tool

If you prefer a graphical interface, there are free tools that can batch-edit metadata:

* **ExifTool** (powerful, but command-line based)
* **Attribute Changer** (adds a right-click menu in Windows Explorer)

With these, you can manually or batch-set Date Created to match Date Modified.

---

### āœ… Option 3: Use the Photo’s EXIF Metadata

Your iPhone embeds the *true taken date* in the EXIF data inside the file. You can:

* Right-click a photo → **Properties → Details tab** to confirm the ā€œDate taken.ā€
* If needed, use **ExifTool** to overwrite Windows ā€œDate Createdā€ with the EXIF Date Taken.

---

šŸ‘‰ Do you want me to give you a ready-to-use **PowerShell script** that you can just drop into your photo folder to automatically fix all the timestamps?


Awesome — here’s a ready-to-use PowerShell script that sets **Date Created** to match **Date Modified** for common photo/video types. It also makes a backup log so you can undo if needed, and it supports a preview mode.

### 1) Save this as `Fix-CreationTime.ps1`

```powershell
<#
.SYNOPSIS
Ā  Set "Date Created" (CreationTime) to match "Date Modified" (LastWriteTime)
Ā  for common photo/video files. Creates a CSV backup log first.

.PARAMETER Path
Ā  Folder to process. Default = current folder (.)

.PARAMETER Recurse
Ā  Include all subfolders.

.PARAMETER Preview
Ā  Show what would change, but don't modify anything.

.PARAMETER Extensions
Ā  File extensions to include. Default covers common image/video types.

.PARAMETER Log
Ā  Path to the CSV backup log. Default = TimestampBackup_yyyyMMdd_HHmmss.csv
#>

param(
Ā  [string]$Path = ".",
Ā  [switch]$Recurse,
Ā  [switch]$Preview,
Ā  [string[]]$Extensions = @(".jpg",".jpeg",".png",".heic",".dng",".tif",".tiff",".gif",
Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  ".mp4",".mov",".avi",".mts",".m2ts",".wmv",".mkv"),
Ā  [string]$Log = ("TimestampBackup_{0}.csv" -f (Get-Date -Format "yyyyMMdd_HHmmss"))
)

# Resolve path and gather files
$resolved = Resolve-Path -Path $Path -ErrorAction Stop
$searchParams = @{
Ā  Path Ā = $resolved
Ā  File Ā = $true
}
if ($Recurse) { $searchParams.Recurse = $true }

$all = Get-ChildItem @searchParams | Where-Object {
Ā  $Extensions -contains ([System.IO.Path]::GetExtension($_.FullName).ToLower())
}

if (-not $all) {
Ā  Write-Host "No matching files found in $resolved" -ForegroundColor Yellow
Ā  return
}

# Backup current timestamps
$backup = $all | Select-Object `
Ā  @{n='FullName';e={$_.FullName}},
Ā  @{n='CreationTime';e={$_.CreationTime}},
Ā  @{n='CreationTimeUtc';e={$_.CreationTimeUtc}},
Ā  @{n='LastWriteTime';e={$_.LastWriteTime}},
Ā  @{n='LastWriteTimeUtc';e={$_.LastWriteTimeUtc}}

$backup | Export-Csv -Path $Log -NoTypeInformation -Encoding UTF8
Write-Host "Backup log saved to: $Log" -ForegroundColor Cyan

# Do the work (or preview it)
$changed = 0
$errors Ā = 0

foreach ($f in $all) {
Ā  try {
Ā  Ā  $fromLocal = $f.CreationTime
Ā  Ā  $toLocal Ā  = $f.LastWriteTime

Ā  Ā  if ($Preview) {
Ā  Ā  Ā  Write-Host "[PREVIEW] $($f.Name)" -NoNewline
Ā  Ā  Ā  Write-Host " Ā CreationTime: $fromLocal Ā -> Ā $toLocal"
Ā  Ā  Ā  continue
Ā  Ā  }

Ā  Ā  # Set both local and UTC to avoid timezone quirks
Ā  Ā  $f.CreationTimeUtc = $f.LastWriteTimeUtc
Ā  Ā  $f.CreationTime Ā  Ā = $f.LastWriteTime

Ā  Ā  $changed++
Ā  }
Ā  catch {
Ā  Ā  $errors++
Ā  Ā  Write-Warning ("Failed to update: {0} Ā ({1})" -f $f.FullName, $_.Exception.Message)
Ā  }
}

if ($Preview) {
Ā  Write-Host "`nPreview complete. No files changed." -ForegroundColor Yellow
} else {
Ā  Write-Host "`nDone. Files updated: $changed Ā | Ā Errors: $errors" -ForegroundColor Green
Ā  Write-Host "If you need to undo, use the CSV log ($Log) to restore times." -ForegroundColor DarkGray
}
```

### 2) Run it

1. Right-click **Start** → **Windows PowerShell (Admin)** (or **Terminal (Admin)**).
2. Navigate to your photo folder, e.g.:

Ā  Ā ```powershell
Ā  Ā cd "C:\Users\YourName\Pictures\iPhone Imports"
Ā  Ā ```
3. **Preview** the changes first (no files modified):

Ā  Ā ```powershell
Ā  Ā .\Fix-CreationTime.ps1 -Preview
Ā  Ā ```
4. **Apply** the changes in the current folder:

Ā  Ā ```powershell
Ā  Ā .\Fix-CreationTime.ps1
Ā  Ā ```
5. Include **subfolders**:

Ā  Ā ```powershell
Ā  Ā .\Fix-CreationTime.ps1 -Recurse
Ā  Ā ```

> If you get an execution policy warning, run this once in the same admin PowerShell window:
>
> ```powershell
> Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
> ```
>
> (Choose **Y** when prompted.)

### Notes & tips

* This script sets **Date Created** to exactly equal **Date Modified** for each file.
* It logs original timestamps to a CSV (`TimestampBackup_…csv`) so you have a record.
* If a file is **read-only** or locked, you’ll see a warning; you can clear read-only attributes via file **Properties → General** or:

Ā  ```powershell
Ā  Get-ChildItem -File -Recurse | ForEach-Object { $_.IsReadOnly = $false }
Ā  ```
* Want to limit to just JPGs? Add: `-Extensions .jpg,.jpeg`

If you’d like a version that uses each photo’s **EXIF ā€œDate takenā€** (when available) instead of Date Modified, I can drop that in too.


Good question — PowerShell won’t prompt you to save the script automatically. You’ll need to create the script file once, then run it when you need it. Here’s how:

---

### šŸ“Œ Step 1: Copy the Script Into a File

1. Open **Notepad** (or any text editor).
2. Copy the entire script I gave you into the blank file.
3. In Notepad, go to **File → Save As…**

Ā  Ā * Navigate to the folder where your photos are (or another convenient location, like Desktop).
Ā  Ā * In the **File name** box, type:

Ā  Ā  Ā ```
Ā  Ā  Ā Fix-CreationTime.ps1
Ā  Ā  Ā ```
Ā  Ā * In **Save as type**, select **All Files**.
Ā  Ā * Make sure it ends with `.ps1`, not `.txt`.

Now you have a PowerShell script file.

---

### šŸ“Œ Step 2: Run the Script

1. Right-click the **Start menu** → select **Windows PowerShell (Admin)** or **Windows Terminal (Admin)**.
2. Go to the folder where you saved the script, e.g.:

Ā  Ā ```powershell
Ā  Ā cd "C:\Users\YourName\Desktop"
Ā  Ā ```
3. Run the script in **preview mode** first:

Ā  Ā ```powershell
Ā  Ā .\Fix-CreationTime.ps1 -Preview -Path "C:\Users\YourName\Pictures\iPhone Imports"
Ā  Ā ```

Ā  Ā * This will just *show* what changes it would make.
4. If everything looks correct, run it for real:

Ā  Ā ```powershell
Ā  Ā .\Fix-CreationTime.ps1 -Path "C:\Users\YourName\Pictures\iPhone Imports"
Ā  Ā ```

---

### šŸ“Œ Step 3: Execution Policy (only needed the first time)

If you see a warning like *ā€œscripts are disabled on this systemā€*, enter:

```powershell
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
```

Choose **Y** when prompted, then re-run the script.

---

šŸ‘‰ Do you want me to make you a **simpler ā€œone-linerā€ script** (just paste into PowerShell without saving a file), or do you prefer the saved `.ps1` script that you can reuse?


Perfect — here’s a version that uses the **EXIF `Date Taken`** metadata instead of `Date Modified`. That way, even if a photo was edited later (which can change the Modified date), you’ll still restore the *actual camera timestamp*.

This script uses the built-in Windows property reader (no extra installs).

---

### šŸ“Œ Script: `Fix-CreationTime-FromExif.ps1`

```powershell
<#
.SYNOPSIS
Ā  Set "Date Created" to the EXIF "Date Taken" value
Ā  (if available). Falls back to Date Modified otherwise.

.PARAMETER Path
Ā  Folder to process. Default = current folder (.)

.PARAMETER Recurse
Ā  Include all subfolders.

.PARAMETER Preview
Ā  Show what would change, but don't modify anything.

.PARAMETER Extensions
Ā  File extensions to include. Default covers common image types.

.PARAMETER Log
Ā  Path to the CSV backup log. Default = TimestampBackup_Exif_yyyyMMdd_HHmmss.csv
#>

param(
Ā  [string]$Path = ".",
Ā  [switch]$Recurse,
Ā  [switch]$Preview,
Ā  [string[]]$Extensions = @(".jpg",".jpeg",".png",".heic",".tif",".tiff",".dng"),
Ā  [string]$Log = ("TimestampBackup_Exif_{0}.csv" -f (Get-Date -Format "yyyyMMdd_HHmmss"))
)

# COM object for reading file metadata
$shell = New-Object -ComObject Shell.Application

function Get-DateTaken {
Ā  Ā  param([string]$FilePath)

Ā  Ā  $folder = $shell.Namespace((Split-Path $FilePath))
Ā  Ā  $file Ā  = $folder.ParseName((Split-Path $FilePath -Leaf))

Ā  Ā  # On most systems, EXIF "Date Taken" is at index 12
Ā  Ā  $taken = $folder.GetDetailsOf($file, 12)

Ā  Ā  if ([string]::IsNullOrWhiteSpace($taken)) { return $null }

Ā  Ā  # Convert from localized string to DateTime
Ā  Ā  try { return [datetime]::Parse($taken) } catch { return $null }
}

# Resolve path & gather files
$resolved = Resolve-Path -Path $Path -ErrorAction Stop
$searchParams = @{ Path = $resolved; File = $true }
if ($Recurse) { $searchParams.Recurse = $true }

$all = Get-ChildItem @searchParams | Where-Object {
Ā  $Extensions -contains ([System.IO.Path]::GetExtension($_.FullName).ToLower())
}

if (-not $all) {
Ā  Write-Host "No matching files found in $resolved" -ForegroundColor Yellow
Ā  return
}

# Backup original timestamps
$backup = $all | Select-Object `
Ā  @{n='FullName';e={$_.FullName}},
Ā  @{n='CreationTime';e={$_.CreationTime}},
Ā  @{n='CreationTimeUtc';e={$_.CreationTimeUtc}},
Ā  @{n='LastWriteTime';e={$_.LastWriteTime}},
Ā  @{n='LastWriteTimeUtc';e={$_.LastWriteTimeUtc}}

$backup | Export-Csv -Path $Log -NoTypeInformation -Encoding UTF8
Write-Host "Backup log saved to: $Log" -ForegroundColor Cyan

# Apply or preview
$changed = 0
$errors Ā = 0

foreach ($f in $all) {
Ā  try {
Ā  Ā  $exifDate = Get-DateTaken $f.FullName
Ā  Ā  $target Ā  = $exifDate ? $exifDate : $f.LastWriteTime
Ā  Ā  $from Ā  Ā  = $f.CreationTime

Ā  Ā  if ($Preview) {
Ā  Ā  Ā  Write-Host "[PREVIEW] $($f.Name)" -NoNewline
Ā  Ā  Ā  Write-Host " Ā CreationTime: $from Ā -> Ā $target"
Ā  Ā  Ā  continue
Ā  Ā  }

Ā  Ā  $f.CreationTimeUtc = $target.ToUniversalTime()
Ā  Ā  $f.CreationTime Ā  Ā = $target

Ā  Ā  $changed++
Ā  }
Ā  catch {
Ā  Ā  $errors++
Ā  Ā  Write-Warning ("Failed to update: {0} Ā ({1})" -f $f.FullName, $_.Exception.Message)
Ā  }
}

if ($Preview) {
Ā  Write-Host "`nPreview complete. No files changed." -ForegroundColor Yellow
} else {
Ā  Write-Host "`nDone. Files updated: $changed Ā | Ā Errors: $errors" -ForegroundColor Green
}
```

---

### šŸ“Œ How to Use

1. Save as `Fix-CreationTime-FromExif.ps1` (same way as before).
2. Open **PowerShell (Admin)** and run in your photo folder:

Ā  Ā **Preview first** (shows what would change):

Ā  Ā ```powershell
Ā  Ā .\Fix-CreationTime-FromExif.ps1 -Preview -Path "C:\Users\YourName\Pictures\iPhone Imports"
Ā  Ā ```

Ā  Ā **Apply for real**:

Ā  Ā ```powershell
Ā  Ā .\Fix-CreationTime-FromExif.ps1 -Path "C:\Users\YourName\Pictures\iPhone Imports"
Ā  Ā ```

Ā  Ā Add `-Recurse` if you want subfolders.

---

āœ… This way, the *true camera-taken time* (from EXIF) is restored into **Date Created**, which is usually what you really want for photo organization.

Would you like me to also add an **option to choose between ā€œuse Date Modifiedā€ vs ā€œuse EXIF Date Takenā€** inside a single script, so you don’t need two separate files?

Reply all
Reply to author
Forward
0 new messages