Pattern: Date and time

“Date and time” is one of the patterns that you can select on the Match panel. Use this pattern to make a field match a date, a time, or any part of or any combination of date and time indicators.

Date Separators

Type in or select one or more characters that can be used to delimit the day, month and year in a numeric date format. In the list of formats, the forward slash / is a placeholder for the date separator characters you specify here. If you specify more than one character, the date separator can be any single one of those.

Time Separators

Type in or select one or more characters that can be used to delimit the day, month and year in a numeric time format. In the list of formats, the forward slash / is a placeholder for the time separator characters you specify here. If you specify more than one character, the time separator can be any single one of those.

AM and PM Indicators

Type the indicators for AM and PM, separated by a semicolon. You can provide more than two indicators if the data you are working with uses different variations (such as "AM,a;PM,p"). Delimit the variations of the same indicator with a comma.

In the list of formats, the lower case "a" is a placeholder for the AM and PM indicators you specify here. If you don't use these indicators, you can leave this field blank.

Names of Months

Type in the names of the 12 months of the year, delimited by semicolons. You can specify more than one name for each month, such as a full name and an abbreviated name. Delimit the alternatives for each month with commas.

In the list of formats, the upper case "M" is a placeholder for the month names you specify here. If you don't use the month names, you can leave this field blank.

Names of Days

Type in the names of the 7 days of the week, delimited by semicolons. You can specify more than one name for each day, such as a full name and an abbreviated name. Delimit the alternatives for each day with commas.

In the list of formats, the upper case "D" is a placeholder for the day names you specify here. If you don't use the day names, you can leave this field blank.

Limit Date Values

Turn on to allow the field to match only dates between a certain beginning and ending date.

Turn off to allow any date.

This option has no effect in the "none" and "loose" field validation modes, which always allow any date.

Limiting date values will make your regular expression significantly more complex. You should only use this feature if a single regular expression is all you can use (e.g. in a text editor). If you'll be using this regular expression in source code, it's far more efficient to let the regular expression match all dates, and put a bit of extra logic in your source code to process only those dates you're interested in.

Beginning Date

Type in the oldest date that the field is allowed to match when limiting date values.

The beginning date is ignored in the "none" and "loose" field validation modes, which always allow any date. In "average" mode, the field will restrict the date's years only. If the years are the same, the months are restricted too. If the months are the same, the days are restricted. In "strict" mode, the regular expression will limit the field to the exact beginning date, which may require a complex regular expression.

Ending Date

Type in the newest date that the field is allowed to match when limiting date values.

The ending date is ignored in the "none" and "loose" field validation modes, which always allow any date. In "average" mode, the field will restrict the date's years only. If the years are the same, the months are restricted too. If the months are the same, the days are restricted. In "strict" mode, the regular expression will limit the field to the exact ending date, which may require a complex regular expression.

Limit Time Values

Turn on to allow the field to match only times between a certain beginning and ending time.

Turn off to allow any time.

This option has no effect in the "none" and "loose" field validation modes, which always allow any time.

Limiting time values will make your regular expression significantly more complex. You should only use this feature if a single regular expression is all you can use (e.g. in a text editor). If you'll be using this regular expression in source code, it's far more efficient to let the regular expression match all times, and put a bit of extra logic in your source code to process only those times you're interested in.

Beginning Time

Type in the oldest time that the field is allowed to match when limiting time values.

The beginning time is ignored in the "none" and "loose" field validation modes, which always allow any date. In "average" mode, the field will restrict the time's hours only. If the years are the same, the minutes are restricted too. If the months are the same, the seconds are restricted. In "strict" mode, the regular expression will limit the field to the exact beginning time, which may require a complex regular expression.

Ending Time

Type in the newest time that the field is allowed to match when limiting time values.

The ending time is ignored in the "none" and "loose" field validation modes, which always allow any time. In "average" mode, the field will restrict the time's hours only. If the years are the same, the minutes are restricted too. If the months are the same, the seconds are restricted. In "strict" mode, the regular expression will limit the field to the exact ending time, which may require a complex regular expression.

Leading zeros

Choose if day, month, hour, minute and second numbers should be padded to two digits using a leading zero. Years must always be padded to 2 or 4 digits. E.g. 1 January 2001 in m/d/y format can be written as:

Allowed Date and Time Formats

Specify the date and/or time format patterns that this field can use. If you specify multiple patterns, separate them with line breaks. The following characters have a special meaning in the date and time formats:

Examples