Use the date conversion operation to convert calendar dates into different formats. For example, your trading partners might send date information using the mm/dd/yy format, but Eclipse stores dates using the mm/dd/yyyy format. Define a date conversion operation to convert the format the format of an element that contains date information.
To convert date formats in XML data:
Right-click a transaction in the Trading Partner Tree and select Edit Transaction Map to display the transaction map.
In the Target XML column of either the received map or the reply/sent map, right-click the element to modify and select Modify Mapping to display the XML Mapping Conversion Editor dialog box.
If the element you select has a source element mapped to it, the source element displays in the Operation Stack field. If the element is not mapped, the Operation Stack field is blank.
From the Operations field, double-click DateConversion to add it to the Operation Stack field.
The Define Format Conversions dialog box displays.
In the Incoming Date Format field, enter the source date format. For an outgoing transaction, this is the format from Eclipse. For received transaction, this is the format from your trading partner.
Use the following notations when entering date formats:
Date Element |
Full Form |
Short Form |
Year |
yyyy |
yy |
Month |
MMM |
MM or M |
Day of week |
EEEE |
EE |
Day of month |
dd |
d |
Hour (1-12) |
hh |
h |
Hour (0-23) |
HH |
H |
Hour (0-11) |
KK |
K |
Hour (1-24) |
kk |
k |
Minute |
mm |
|
Second |
ss |
|
Millisecond |
SSS |
|
AM/PM |
a |
|
Time zone |
zzzz |
zz |
Day of week in month (for example, the third Thursday) |
F |
|
Day in year |
DDD |
D |
Week in year |
ww |
|
Era (for example, BC or AD) |
G |
|
Note: Date format notations are case sensitive. For example, to convert an incoming date from mm/dd/yy to contain a four digit year, enter MM/dd/yyyy for the outgoing date format.
In the Outgoing Date Format field, enter the format to which to save the date in all lowercase letters.
For a sent transaction, this is the format that your trading partner requires. For a received transaction, this is the format Eclipse requires.
Click OK to return to the XML Mapping Conversion Editor dialog box.
If necessary, move the operation to the correct place in the operation stack.
Typically, the date conversion operations fall after the data you need to convert:
Add additional sources and operations, as necessary.
Click OK to return the mapping utility main window.
From the File menu, select Save Transaction Map to save the map.
See Also: