Date format

47 views
Skip to first unread message

bruno.buzzi

unread,
Apr 7, 2016, 3:18:34 PM4/7/16
to orb...@googlegroups.com
Hi,

Orbeon 4.6.

In the properties-local.xml we have:
<property as="xs:string" name="oxf.xforms.format.input.date"
value="[D]/[M]/[Y]"/>

But if i check the xml in the database the following is stored:
<form>
<section-1>
<dateAndTime>2016-04-08T06:01:00</dateAndTime>
<date>2016-04-27</date>
<time>16:47:15</time>
</section-1>
</form>

Is this correct ?
Or the date should be 27/04/2016 ?

Reading http://doc.orbeon.com/configuration/properties/xforms.html
It should be 27/04/2016 or not ?

Regards,
Bruno

--
View this message in context: http://discuss.orbeon.com/Date-format-tp4661375.html
Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.

Alessandro Vernet

unread,
Apr 7, 2016, 5:57:51 PM4/7/16
to orb...@googlegroups.com
Hi Bruno,

What you're seeing is correct. By design, dates and times are always stored
in the ISO format. What the property sets is a formatting preference. And
you could imagine that this changes over time or across users, say because
of language or individual preferences. But in all cases, you wouldn't want
the format for what is stored in your database to change.

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
View this message in context: http://discuss.orbeon.com/Date-format-tp4661375p4661376.html

bruno.buzzi

unread,
Apr 8, 2016, 9:38:02 AM4/8/16
to orb...@googlegroups.com
Alex,

Yes is much better to store all date in the same predefined way. But this
property when is used ?

Is used only when entering a date in a TextEdit component ?

Regards,
bruno

--
View this message in context: http://discuss.orbeon.com/Date-format-tp4661375p4661382.html

Alessandro Vernet

unread,
Apr 8, 2016, 2:06:16 PM4/8/16
to orb...@googlegroups.com
Hi Bruno,

It's used by the regular date field, that is an <xf:input> bound to a node
of type xs:date, or xs:dateTime, but also by Dropdown date and Fields date
XBL components, to determine in which order to show the year, month, and day
parts of the date.

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
View this message in context: http://discuss.orbeon.com/Date-format-tp4661375p4661384.html

bruno.buzzi

unread,
Apr 8, 2016, 3:25:43 PM4/8/16
to orb...@googlegroups.com
Alex,

Thanks for the answer.

Got it :)

Regards,
bruno

--
View this message in context: http://discuss.orbeon.com/Date-format-tp4661375p4661385.html

Jason

unread,
Jan 22, 2025, 4:47:30 PMJan 22
to Orbeon Forms
Dealing with the issue around this and a pdf template.  The form date picker choses a date in mm/dd/yyyy format however when we use a pdf template with form fields the output is how the date is stored in the database with yyyy/mm/dd.  How can i resolve this?  I've tried all the various settings I could find to configure the output without success.  An older version of orbeon running on tomcat9 on windows seems to display the date correctly.  The new servers are ubuntu with tomcat 10.x and the latest version of orbeon.

Alessandro Vernet

unread,
Jan 22, 2025, 10:49:02 PMJan 22
to orb...@googlegroups.com
Hi Jason,

I have tried to reproduce this issue using the built-in DMV 14 sample form, which uses a PDF template. By default, the date format is MM/DD/YYYY. If I generate a PDF without changing the format, the date appears in that MM/DD/YYYY format. However, if I edit the form and change the format to DD/MM/YYYY, the date appears with the day first in the generated PDF.

But you're saying that in your case, the format in the PDF is always YYYY/MM/DD, regardless of the date format setting in the form. Is that correct? If so, are you able to reproduce the same behavior with the DMV 14 form?

-Alex
Reply all
Reply to author
Forward
0 new messages