DO9: Modifying format of {time} impossible?

Hello,

I just tried to rename files using regular expressions and the {time} control code.

Old Name:

(.*)\.([-a-z0-9_]+)

New Name:

\1_{date|D#yyyy+MM+dd}_{time|T#HH-mm-ss}.\2

Result:

changelog.html  =>  changelog_2007-04-29_05;03;06.html

The only way to eliminate the semicolons between hours, minutes and seconds is to delete the "T" before the "#". But even then it's impossible to insert other characters instead. Applying single quotation marks as suggested in the manual doesn't work either.

Did I miss something (I searched the manual as well as the forum but didn't find anything about it), or is this a bug in DOpus 9?

BTW: For the date it didn't work as stated in the manual either - I had to insert "D#" to be able to change the characters between year, month and day (the plus signs I just entered for testing). {dateu} and {timeu} didn't work at all...

Thank you very much in advance for your assistance!

Greetings,
Jan

the time format seems to be read from windows. You should go to control panel -> time zone to set up by yourself.

Then the separator should be a colon instead of a semicolon - that's the format I set it to. Does DOpus convert this to a semicolon because colons are not allowed in file names?

Apart from that, the manual says the time format can be adjusted in a similar was as the date format. And this doesn't work, as it seems. Or am I doing (or expecting) something wrong?

Greeting,
Jan

Edit: What I posted here is correct for buttons that contain rename patterns, like in the thread I linked to, but it isn't correct for the rename dialog.

The problem is the D# and T# in the formats. You don't need those with {date} and {time} as they are implicitly date and time values. D# and T# are only used with things like {shootingtime} which is a date-time value.

I will file a small feature request to make {date} and {time} accept D# and T# as it would be nicer if the same formats could be used in all cases. The difference is more for historical reasons than to make things more complex on purpose.

Try these:

{date|yyyy+MM+dd} {time|HH-mm-ss}

This post in the Rename Scripting forum may also help you: [Add the current date and time to a file's name)

1 Like

[quote="nudel"]The problem is the D# and T# in the formats. You don't need those with {date} and {time} as they are implicitly date and time values. D# and T# are only used with things like {shootingtime} which is a date-time value.

I will file a small feature request to make {date} and {time} accept D# and T# as it would be nicer if the same formats could be used in all cases. The difference is more for historical reasons than to make things more complex on purpose.

Try these:

{date|yyyy+MM+dd} {time|HH-mm-ss}[/quote]
This is what I tried first because it's described this way in the manual. The format strings have absolutely no effect when I do this as you can see on the screenshot. Inserting "D#" did the trick for the date as I said before, but for the time entry it doesn't work either. If I just enter "#" without a character before it, at least the semicolons (do you say "semicola" in English as we do in German?) disappear, but I'm still not able to modify the time string.

Any ideas? If it works in your version: Could this be a bug in the German version of DO9?

Greetings,
Jan

Oh, you're right. It happens in the English Opus as well. I'll open a request to get it fixed.

The stuff I posted above was correct for buttons which contain regular expressions, so that is a workaround for now (see the thread I linked). The rename dialog works slightly differently it seems.

Thank you very much!

That's right, setting up a button with this function is no problem, but I'd rather like to create some presets for the Rename dialog. :wink:

Greetings,
Jan

This is fixed in Opus 9.0.0.1:[ul][li]...[/li]
[li] Fixed formatting of {time} field in Advanced Rename[/li]
[li]...[/li][/ul]Full list of changes here: [Directory Opus 9.0.0.1)