1.3.10.8 Convert Date to String
The Convert Date to String transformer takes any number of DATE or DATEARRAY attributes, and converts them to a STRING or STRINGARRAY type respectively.
Use Convert Date to String when you want to treat the date as a text, for processing purposes. For example, in order to extract the day, month and year parts of a date to separate attributes for matching, you may want to convert the date to a String type, and then use Trim Characters to extract the different parts.
Note that the Date is converted to a String value with a standard international format for dates (dd-MMM-yyyy
, for example, 25-Apr-2006).
The following table describes the configuration options:
Configuration | Description |
---|---|
Inputs |
Specify any number of Date or Date Array attributes that you want to convert to a String or String Array type. |
Options |
Specify the following options:
|
Outputs |
Describes any data attribute or flag attribute outputs. |
Data Attributes |
For each attribute input, a new attribute is created in the following format:
|
Flags |
None. |
The Convert Date to String transformer presents no summary statistics on its processing. In the Data view, each input attribute is shown with its new derived String type attribute to the right.
Output Filters
None.
Example
In this example, Convert Date to String is used to convert a DT_LAST_PAYMENT attribute to a String type. Note that in this example, the time element is stripped during the date conversion by deleting the time element (HH:mm:ss
) from the Output Format.
DT_LAST_PAYMENT | DT_LAST_PAYMENT.DateToString |
---|---|
11-Mar-2000 00:00:00 |
11-Mar-2000 |
16-Sep-2003 00:00:00 |
16-Sep-2003 |
15-Mar-2000 00:00:00 |
15-Mar-2000 |
05-Oct-2001 00:00:00 |
05-Oct-2001 |
{05-Oct-2001 00:00:00}{12-Apr-2000 00:00:00} |
{05-Oct-2001}{12-Apr-2000} |