Extract Year

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.

Properties

The Extract Year data converter is configured using the following properties:

Locale

Specifies the locale that is used in the date.

Date Format Pattern

Contains a pattern that specifies the format of the date from which the year should be extracted. See the syntax description below.

Max. Months Ahead

The maximum number of months to look ahead. This field takes effect only in the absence of an explicit year when using the 'dd' and 'MM' patterns.

Max. Days Ahead

The maximum number of days to look ahead. This field takes effect only in the absence of an explicit month when using the 'dd' and 'yyy' patterns.

Description

Type in a description to be shown in the list of data converters. If there is no type in a description, one will be generated.

Syntax of the Date Format Pattern

The following patterns can be combined to create the pattern in the Date Format Pattern property:

Pattern

Description

yy

Exactly two digit year

yyy

Any 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)

Space

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:

Wednesday

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.