Formating Dates Using the DateFormatter Transformer
Article Number: 000001414 - Last Modified: Jan 25, 2012
The DateFormatter transformer can be used to transform data from a select number of source date formats to an output format as specified by a user.
Description
The DateFormatter takes an attribute containing a date in a format recognised by the transformer and converts it to a different format specified by the user.
The attached workspace shows an example use of the DateFormatter transformer.
In this example, a number of Date attributes are created with various source values including one blank value, two invalid values and a number of relative values. The DateFormatter reformats each one into a valid date if it recognizes the source format. If no source data is provided then it returns today's date.
Workspace Screenshot

Above: The workspace as a whole is very simple.

Above: The AttributeCreator can even set a date to "Next Thursday"...

Above: ...which the DateFormatter interprets as 14-Jul-2011 (which is indeed next Thursday - or was at the time this screenshot was taken). Also notice the two invalid dates. |
Suggested Similar Articles