The Extract Year data converter extracts a year from a date in the input text. The date may be incomplete, such as containing only the year.
The Extract Year data converter is configured using the following properties:
The following patterns can be combined to create the pattern in the Date Format Pattern property:
|yy||Exactly two digit year|
|yyyy||Exactly four digit year|
|MM||One or two digit month, abbreviations or full names of months|
|dd||One or two digit date|
|EEE||Short weekday name (e.g. Mon instead of Monday).|
|EEEE||Full weekday name (e.g. Monday).|
|hh or HH||One or two digit hour|
|mm||One or two digit minute|
|ss||One or two digit second|
|a||AM or PM marker|
|Z||Time Zone identifier (e.g. "PST", "Central European Time" or "GMT+02:00").|
|*||Skip any number of characters (this must be used in order to skip alphanumeric characters a-z and A-Z)|
||Skip one or more white spaces|
|Any other non-alphanumeric character||Skip that exact character (use * to skip alphanumeric characters)|
If the weekday patterns ('EEE' and 'EEEE') are used and the date pattern ('dd') is not used, then the month and year patterns ('MM' and 'yy'/'yyy'/'yyyy') cannot be used. In this case, the date found is the next day with a name matching the pattern. For example, if the pattern is 'EEEE' and the input is the following text:
the year found is the year of the next Wednesday.
If the weekday patterns are used together with the date pattern (and possibly the month and year patterns), the weekday is discarded. For example, if the pattern is 'EEE, dd/MM/yyy' and the input is the following text:
the year found is '2003'.
Note: The 'EEE' pattern matches the short names of the weekdays (e.g. Mon, Tue etc.). If the pattern should match the entire weekday name, use the 'EEEE' pattern. For example, if the input is the following text:
"Thus, let us meet on Wednesday"
the pattern 'EEEE' should be used, since the pattern 'EEE' would match 'Thu' causing the Extract Year data converter to find the year of the next Thursday.
Here are some examples of format patterns and matching dates:
|Date Format Pattern||Matching Dates|
|dd. MM yyy||4. jan 1993
4. january 93