I use a date, time and filename macro which generates the following: 12/3/2022 - 2:57 AM - P:\doc2.txt
Is it possible to convert the date display to 2022-12-03 format?
Formatting the system date in a macro
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Formatting the system date in a macro
TextPad 8.16.0 64bit in English and TextPad 9.1.0 64bit in French, on two separate Windows installations
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
It looks like your dates are in crazy US format. Try:
Search | Replace... (<F8>):
Search | Replace... (<F8>):
You can put this in a macro:Find what: \b(\d)?(\d)/(\d)?(\d)/(\d{4})\b
Replace with: $5-(?1$1:0)$2-(?3$3:0)$4
[X] Regular expression
Do you not want the time put into 24-hour format?Replace = "\\b(\\d)?(\\d)/(\\d)?(\\d)/(\\d{4})\\b", "$5-(?1$1:0)$2-(?3$3:0)$4", RegExp
DoReplaceAll
Much thanks for taking the time to help. It's in a new Windows 10 22H2 install whichstill needs a lot of configuration adjustments. The time format is OK.ben_josephs wrote:It looks like your dates are in crazy US format. Try:
Search | Replace... (<F8>):You can put this in a macro:Find what: \b(\d)?(\d)/(\d)?(\d)/(\d{4})\b
Replace with: $5-(?1$1:0)$2-(?3$3:0)$4
[X] Regular expressionDo you not want the time put into 24-hour format?Replace = "\\b(\\d)?(\\d)/(\\d)?(\\d)/(\\d{4})\\b", "$5-(?1$1:0)$2-(?3$3:0)$4", RegExp
DoReplaceAll
TextPad 8.16.0 64bit in English and TextPad 9.1.0 64bit in French, on two separate Windows installations