Hazel - How do you convert Text Month to Number ie September to 09

My Chase bank statements has the dates as September 01, 2022 to September 30, 2022

I would like to get the date and then rename the file

2022-09 Chase XXXX Account Number

How do I convert September to 09

You can use a bit of shell script:

date -v"September 01, 2022" +%Y-%m

This will result in the date string “2022-09”

This should be able in Hazel directly with a custom date format in the “contains match” option (see screenshot):

You can define the month to be recognized in alphanumeric format, and if you safe that custom format you should be able to re-use it again for the action part of the Hazel rule so that you use that recognized date for renaming.


Thanks so much! Appreciate your help. Mac power users is my second brain.