You are not logged in.
Pages: 1
I need some help on covering the fallowing Date Time stamp from 24 December 2018 7:52 AM to 2018/12/24 07:52:00.
Offline
Hi Steph,
This is untested however it should work. I got the date format rules for SimpleDateFormat from here. Specifically look at "Pattern Syntax" and "Pattern Examples" on that page.
<sxi:DataDefinition name="ConvertDate">
<sxi:Fields>
<sxi:Field name="InDate">
<sxi:Rules>
<sxi:DateConverter InputDateFormat="dd MMMM yyyy h:mm a" OutputDateFormat="yyyy/MM/DD HH:MM:ss"/>
</sxi:Rules>
<sxi:OutputField>OutDate</sxi:OutputField>
</sxi:Field>
</sxi:Fields>
</sxi:DataDefinition>
Not sure how you are going to get the seconds as they are not provided in the input example you gave.
Ciao
Sean
Offline
Hi Sean,
There is no input for the seconds, I will test it and let you know.
Thx.
Offline
It's working correct with this Date Converter rule, I changed the Output Date Format to "yyyyy/MM/dd HH:mm:ss".
The seconds are not provided in the input, it will default to "00".
<sxi:Rules>
<sxi:DateConverter InputDateFormat="dd MMMM yyyy h:mm a" OutputDateFormat="yyyy/MM/dd HH:mm:ss"/>
</sxi:Rules>
I have tested the AM / PM .
Tested with Input "24 December 2018 7:52 PM"
Output ----------- <DateTime>2018/12/24 19:52:00</DateTime>
Tested with input "24 December 2018 7:52 AM"
Output ----------- <DateTime>2018/12/24 07:52:00</DateTime>
Last edited by StephanB (30-12-2018 14:35:59)
Offline
Pages: 1