Changing Date Format

A swapping-ground for Regular Expression syntax

Changing Date Format

Postby rja541 » Wed Mar 01, 2023 3:05 pm

I have a document system which has a date format which I need to change

The documents currently read: DD.MM.YY - Document Name

e.g. 13.01.23 - Notice of Transfer

What I need is to convert the DD.MM.YY format to YYYY.MM.DD

e.g. 2023.01.13 - Notice of Transfer

Can anyone help?

Thanks in advance.
rja541
 
Posts: 1
Joined: Wed Mar 01, 2023 2:52 pm

DD.MM.YY ===> 20YY.MM.DD

Postby Luuk » Wed Mar 01, 2023 7:42 pm

With RegEx(1) the "Match" and "Replace" can be something ike...
^(\d\d)(\.\d\d\.)(\d\d)( - .+)
20\3\2\1\4

13.01.23 - Notice of Transfer -----> 2023.01.13 - Notice of Transfer
Luuk
 
Posts: 706
Joined: Fri Feb 21, 2020 10:58 pm


Return to Regular Expressions