How do I find/replace by date?
The Find and Replace features allow you to find by a date range. This how-to describes how to find dates and, if you’d like, replace the date with a different format.
- Open the Find dialog (Search | Find…).
- Change to the Number Range type. By default, the Enter Number Range dialog will pop up.
- Change to Date/times. Note that the system default locale will be used for the date format. If the date format in your document is different, you must uncheck Use default date format and choose the correct format.
- If the date format is
M/d/yyyy
, enter1/1/1900
to Minimum number and12/31/2100
to Maximum number. If your date format is different, enter the dates in your format.
- Click OK. The date range will be added to the Find field.
- Click Find Next. A date in your document should be highlighted. This verifies that you entered the correct date format. You can now specify a specific date range if you wish.
Converting date formats
- Open the Replace dialog (Search | Replace…). Change the Find field to the date range that we created before.
- In the Replace with field, enter
\Dyyyy-MM-dd
. You can read about the replacement syntax here. - Click Replace. A matching date should have been converted to the format given by the replacement expression.