#1 2024-08-03 14:03

anemone
Member
Registered: 2024-08-03
Posts: 1

need help with changing yyyy-mm-dd hh:nn:ss to yyyy-mm-dd +rearranging

I tried to reformat the date from yyyy-mm-dd hh:nn:ss to yyyy-mm-dd but it didn't work


File name:

ShouldHaveCat-[2024-07-28 07ː47ː19 UTC]-1817466855679820101_3

What i want:

2024-07-28-ShouldHaveCat-1817466855679820101_3

Offline

#2 2024-08-04 08:41

blackvoid
Member
Registered: 2024-08-04
Posts: 2

Re: need help with changing yyyy-mm-dd hh:nn:ss to yyyy-mm-dd +rearranging

I don't know what you mean by reformat date but this should work.

Add rule, choose 'Regular Expressions'.

Add the following :

Expression : ^(.+)-\[(\d{4}-\d{2}-\d{2}).*\]-(.+)$
Replace : $2-$1-$3
Skip Extension : make sure its ticked.

Save rule.

Offline

#3 2024-08-05 00:20

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,433

Re: need help with changing yyyy-mm-dd hh:nn:ss to yyyy-mm-dd +rearranging

anemone wrote:

I tried to reformat the date from yyyy-mm-dd hh:nn:ss to yyyy-mm-dd but it didn't work

File name: ShouldHaveCat-[2024-07-28 07ː47ː19 UTC]-1817466855679820101_3

It looks like the reason why the Reformat Date rule does not work in your example is because it contains an unusual time separator character “ː” (U+02D0) known as "Modifier Letter Triangular Colon", but the source format in the rule uses a common colon character “:” (U+003A).

Despite looking virtually same in most fonts, they are different characters.

The solution is simple. You need to adjust the source date/time pattern in the rule to use the unusual colon symbol, as follows:

yyyy-mm-dd hhːnnːss

Instead of:

yyy-mm-dd hh:nn:ss

Offline

Board footer

Powered by FluxBB