Date/Time Formatting

Logic name
Date/Time Formatting (Document Mapper/Variable Mapper/Merge Mapper)
Function
This logic outputs the date/time of the input data in the specified format.
Data types
Location |
Type |
---|---|
First input handler |
Date |
Logic output |
String |
Refer to the following for details:
-
Logic specifications (Document Mapper/Variable Mapper)
-
Logic specifications (Merge Mapper)
Properties
Category |
Property |
Description |
---|---|---|
Required settings |
Format |
Specify the date format of the custom type. |
Comment |
Comment |
You can write a description of the logic. It doesn't affect the conversion process. |
Function details
The date/time formatting uses java.text.SimpleDateFormat.
For further details about SimpleDateFormat, refer to "Java(TM) Platform, Standard Edition 8 API Specification" (http://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html).
Format is used when converting date/time to string.
A-Z and a-z without quotation marks are interpreted as pattern letters. This interpretation can be avoided by enclosing the text with single quotation marks ('). To avoid the interpretation of single quotation, represent single quotation in double ('').
Character |
Description |
Representation |
Example |
---|---|---|---|
G |
Era |
Text |
AD |
y |
Year |
Year |
1996;96 |
M |
Month |
Month |
7 |
w |
Week of the year |
Numeric |
27 |
W |
Week of the month |
Numeric |
2 |
D |
Day of the year |
Numeric |
189 |
d |
Day of the month |
Numeric |
10 |
F |
Day of the week in the month |
Numeric |
2 |
E |
Day of the week |
Text |
Wednesday |
a |
AM/PM |
Text |
AM |
H |
Hour of day (0 - 23) |
Numeric |
0 |
k |
Hour of day (1 - 24) |
Numeric |
24 |
K |
Hour in AM/PM (0 - 11) |
Numeric |
0 |
h |
Hour in AM/PM (1 - 12) |
Numeric |
12 |
m |
m |
Numeric |
30 |
s |
s |
Numeric |
55 |
S |
ms |
Numeric |
978 |
z |
Time zone |
General time zone |
Japan Standard Time; JST; GMT+09:00 |
Z |
Time zone |
RFC 822 time zone |
+0900 |
Format notation example
Format |
Result |
---|---|
yyyy/MM/dd HH:mm:ss.SSS z |
2005/01/23 12:34:56.789 JST |
''yy/M/d HHmmssZ |
'05/1/23 123456+0900 |
MMMM d, yyyy G (E) |
January 23, 2005 AD (Sun) |
aa K hour m minute s second S millisecond zzzz |
0 hour m minute 56 second 789 millisecond PM, Japan Standard Time |
HH'h'mm'm'ss's'SSS'ms’ |
12h34m56s789ms |
yyyy-MM-dd'T'HH:mm:ss.SSSZZ |
2005-01-23T12:34:56.789+0900 |
The date/time is Japanese local time 12:34:56.789 January 23, 2005.
Logic sample
Mapping definition

Logic settings and processing result
The date/time data is converted to format "yyyy year MM month dd day HH hour mm minute ss second".
Property settings
Property |
Setting |
---|---|
Format |
yyyy year MM month dd day HH hour mm minute ss second |
Input data
1985-05-11T01:02:03.004+0900 |
2000-09-01T10:20:30.040+0900 |
2010-10-17T23:58:59.999+0900 |
Output data
1985 year 05 month 11 day 01 hour 02 minute 03 second |
2000 year 09 month 01 day 10 hour 20 minute 30 second |
2010 year 10 month 17 day 23 hour 58 minute 59 second |
For a list of logics, refer to Mapper Logic Guide.