Use mediainfo (Recorded date) as Modified date?

Bulk Rename Utility How-To's

Use mediainfo (Recorded date) as Modified date?

Postby art2work4 » Mon Nov 03, 2025 11:07 am

So I have installed the mediainfo dll and have a mp4 file. In mediainfo (right-click on mp4 file) I see: Recorded date 2023-01-16 16:48:33+01:00.

Now I want to use that date/time as Date Modified and Date Created.
What is the best way to do this?

Thanks
art2work4
 
Posts: 3
Joined: Sun Nov 02, 2025 8:31 am

Re: Use mediainfo (Recorded date) as Modified date?

Postby Admin » Mon Nov 03, 2025 11:41 am

Use Bulk Rename Utility’s Javascript Renaming (Special (14) -> Javascript Renaming) to read the MediaInfo date and assign it to newCreated and newModified. That lets you set both Created and Modified in one operation.

Prechecks
- Confirm the MediaInfo DLL is copied into the Bulk Rename Utility program folder and BRU has been restarted. (If MediaInfo tags are available you can also see them in the right-click > List of File Properties dialog.)
- If the MediaInfo tag you saw in the GUI was shown as "Recorded date" or as the example "File_Created_Date_Local", use the matching tag name below.

Step-by-step (quick)
1. Select the MP4 file(s) in BRU.
2. Open Special (14) -> Javascript Renaming.
3. Paste the script below into the editor.
4. Preview and run Rename. The script will set both Created and Modified to the MediaInfo recorded date if found.

Example JavaScript (copy/paste into BRU JS box)
(Note: this handles a couple of common tag name variations and falls back to leaving timestamps unchanged if no valid date found.)

Code: Select all
// Try MediaInfo tags that BRU exposes
var d = null;

// Preferred: MediaInfo local file created date (example tag used in docs)
d = filePropertyDate("MediaInfo:File_Created_Date_Local");

// If that returned null, try common alternative names
if (!d) d = filePropertyDate("MediaInfo:Recorded_Date");
if (!d) {
    // some builds expose as a plain string via fileProperty; try that and parse
    var s = fileProperty("MediaInfo:Recorded_Date") || fileProperty("MediaInfo:File_Created_Date_Local");
    if (s) {
        // try to parse ISO-like string
        var parsed = new Date(s);
        if (!isNaN(parsed)) d = parsed;
        // if parsing fails, try trimming timezone forms (optional)
    }
}

if (d) {
    // assign both Created and Modified to MediaInfo date
    newCreated = d;
    newModified = d;
} else {
    // optional: leave unchanged or set a fallback
    // newCreated = object("created"); newModified = object("modified");
}



Notes
- filePropertyDate("MediaInfo:File_Created_Date_Local") is the documented tag example; if your BRU shows the property under a slightly different label (check right-click > List of File Properties), use that exact label in filePropertyDate("...") or fileProperty("...").
- The script expects the tag to be returned as a Date (filePropertyDate) or a parseable string. If the MediaInfo value has a weird format you may need slight parsing adjustments.
- You can test on one file first. The JS editor supports previewing results.
Admin
Site Admin
 
Posts: 3097
Joined: Tue Mar 08, 2005 8:39 pm

Re: Use mediainfo (Recorded date) as Modified date?

Postby art2work4 » Mon Nov 03, 2025 12:23 pm

Great ! It worked, I just needed to change the tag into "MediaInfo:MediaInfo:Tagged_Date", since this tag also includes HHMMSS.

thanks for the great help
art2work4
 
Posts: 3
Joined: Sun Nov 02, 2025 8:31 am


Return to How-To