4.1.0.1 Old Modified

Post any Bulk Rename Utility support requirements here. Open to all registered users.

4.1.0.1 Old Modified

Postby chrisjj » Wed Mar 18, 2026 3:48 pm

Using the script below to set Modified, how do get to see the old Modified in the file list. The "Modified" column shows the new Modfied.

Thanks.

Code: Select all
// Example:
// name = "2020-03-18 13h45 Report.pdf"
// After: filename remains "2020-03-18 13h45 Report.pdf", modified date set to 2020-03-18 13:45
// Example placeholder time:
// name = "2020-03-18 __h__ Notes.txt"
// After: filename remains unchanged, modified date set to 2020-03-18 00:00

// try to extract date and time
var match = name.match(/^(\d{4})-(\d{2})-(\d{2})\s+(\d{1,2})h(\d{2})/);
var year, month, day, hour, minute;
if (match) {
    // full time present
    year   = parseInt(match[1], 10);
    month  = parseInt(match[2], 10) - 1; // JS months are zero-based
    day    = parseInt(match[3], 10);
    hour   = parseInt(match[4], 10);
    minute = parseInt(match[5], 10);
} else {
    // try placeholder "__h__"
    match = name.match(/^(\d{4})-(\d{2})-(\d{2})\s+__h__/);
    if (match) {
        year   = parseInt(match[1], 10);
        month  = parseInt(match[2], 10) - 1;
        day    = parseInt(match[3], 10);
        hour   = 0;
        minute = 0;
    }
}
// if we found a date, set the modified timestamp
if (match) {
    newModified = new Date(year, month, day, hour, minute, 0);
}
// keep the filename unchanged
newName = name;
chrisjj
 
Posts: 124
Joined: Wed Mar 30, 2011 5:26 pm

Re: 4.1.0.1 Old Modified

Postby Admin » Wed Mar 18, 2026 5:52 pm

Only the new Modified date is shown in the file list. To show the old modified timestamp you would need to deselect the file so it will show the current timestamp.
Admin
Site Admin
 
Posts: 3168
Joined: Tue Mar 08, 2005 8:39 pm

Re: 4.1.0.1 Old Modified

Postby chrisjj » Wed Mar 18, 2026 11:58 pm

Thanks for the workaround, dangerously error prone.

Please pass on my request for Old Modified and New Modified columns. Thanks.
chrisjj
 
Posts: 124
Joined: Wed Mar 30, 2011 5:26 pm

Re: 4.1.0.1 Old Modified

Postby Admin » Thu Mar 19, 2026 1:21 pm

I will, thank you for the suggestion! 8)
Admin
Site Admin
 
Posts: 3168
Joined: Tue Mar 08, 2005 8:39 pm

Re: 4.1.0.1 Old Modified

Postby chrisjj » Thu Mar 19, 2026 3:19 pm

Admin wrote:I will, thank you for the suggestion! 8)


You're weclome!
chrisjj
 
Posts: 124
Joined: Wed Mar 30, 2011 5:26 pm


Return to BRU Support


cron