Page 1 of 1
USA dates to UK?
Posted: Sun May 14, 2023 1:38 pm
by terrypin
I'm struggling to convert USA dates like these:
9/26/20
10/9/21
12/21/22
to these UK equivalents:
26/9/20
9/10/21
21/12/22
Even better would be padded results like this:
26/09/20
09/10/21
21/12/22
Is it possible in a single run please?
Re: USA dates to UK?
Posted: Sun May 14, 2023 9:15 pm
by AmigoJack
You could have
searched the forums and would have found
Formatting the system date in a macro:
ineuw wrote: Sat Dec 03, 2022 8:05 am12/3/2022
...
Is it possible to convert the date display to 2022-12-03 format?
That's halfway what you want: a date in the US format and adding leading zeroes (minus the century in the year).
ben_josephs wrote: Sun Dec 04, 2022 11:07 pm
Search | Replace... (
<F8>):
Find what: \b(\d)?(\d)/(\d)?(\d)/(\d{4})\b
Replace with: $5-(?1$1:0)$2-(?3$3:0)$4
[X] Regular expression
While the output is not what you want, over all the years you surely learnt at least basics of regex. So you just have to adapt to it and want to actually search for a 2 digit year only:
and replace it in a just different order:
Successfully tested with 8.4.2.
Re: USA dates to UK?
Posted: Wed Jan 03, 2024 2:09 am
by ineuw
Forgive me for this late reply. I appreciate your efforts and much thanks.