Skip to content

Fix incorrect dates of WhatsApp images in Google Photos by extracting the original date and time from filenames and updating the file metadata.

License

Notifications You must be signed in to change notification settings

vishwas-r/whatsapp-image-date-fixer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WhatsApp Image Date Fixer

This PowerShell script helps fix incorrect dates for WhatsApp images in Google Photos by extracting the original date and time from filenames and updating the file metadata.

Problem

When WhatsApp images are backed up, transferred, or restored, the original date and time may be lost. Google Photos often relies on file metadata to organize images, leading to incorrect dates being displayed if the metadata is overwritten. This script addresses the issue by extracting the correct dates from the file names and updating the metadata.

Features

  • Supports common WhatsApp image filename formats:
    • IMG-YYYYMMDD-WA####.jpg
    • IMG_YYYYMMDD_HHMMSS.jpg
  • Extracts the correct date and time from filenames.
  • Updates the file's creation and modification metadata to reflect the original date.

Requirements

  • Windows PowerShell (pre-installed on most Windows systems).
  • Exiftools - Already present in the repo.

How to Use

  1. Prepare Your Files

    • Place all WhatsApp images with incorrect dates into a single folder.
    • Ensure the filenames follow WhatsApp’s standard naming conventions.
  2. Download the Repo

    • Save the repo & extract all the files (FixWhatsAppDates.ps1 & exiftools) to the same folder.
  3. Run the Script

    • Open PowerShell.
    • Navigate to the folder containing the script and your media files:
      cd "C:\path\to\your\folder"
    • Execute the script:
      .\FixWhatsAppDates.ps1
  4. Verify the Changes

    • Check the file properties to confirm the updated creation and modification dates.
    • Re-upload the files to Google Photos to reflect the correct dates.

Notes

- Default Time: If the filename does not specify a time, the default time of 10:00:00 is used.
- File Backup: Always back up your files before running the script.

Feel free to submit issues or pull requests to improve the script.

About

Fix incorrect dates of WhatsApp images in Google Photos by extracting the original date and time from filenames and updating the file metadata.

Topics

Resources

License

Stars

Watchers

Forks

Languages