You are not logged in.
Pages: 1
This rule changes the format of the given date to one you specify.
Example:
Date= “15/03/2019”
The above "Date" is in a dd/MM/yyyy format, we want to change the format to yyyy-MM-dd.
<sxi:Field name="//*[local-name()=’Date’]">
<sxi:Rules>
<sxi:DateConverter InputDateFormat="dd/MM/yyyy" OutputDateFormat="yyyy-MM-dd"/>
</sxi:Rules>
<sxi:OutputField>Date</sxi:OutputField>
</sxi:Field>
After using the above config "Date" will look as follows:
Date = "2019-03-15"
You can also use "DateConverter" for time.
To see examples of pattern syntax follow the link bellow (found at the bottom of the article):
https://www.journaldev.com/17899/java-s … ate-format
Attributes:
InputDateFormat:
The format that is being used as the input.
OutputDateFormat:
The format that is expected.
Offline
The "DateConverter" can also be used to input the current date in the format that you define in the "<OutputDateFormat>" attribute.
To do this however, the attribute "<InputDateFormat>" MUST be empty.
E.g
<sxi:DateConverter InputDateFormat="" OutputDateFormat="dd-MM-yyyy"/>
Last edited by MarekR (26-03-2019 14:57:35)
Offline
Pages: 1