QUINDIP: format your dates from backend documents properly

we use a standard date format in our company: 2013-04-30 22:52

to accomplish this I use:

When you simply use a data binding this works like a breeze.
It’s a bit more complicate if you want to display a date/time from a backend document with Java

 this won’t work:

doc.getItemValueString(“fieldName”)
doc.getItemValue(“fieldName”).get(0)
doc.getItemValueDateTimeArray(“fieldName”).get(0)

this will work:
doc.getItemValueDateTimeArray(“fieldName”).get(0).toJavaDate()

and just as a side note: I really feel stupid! it took me hours to figure out how to get it to work!!! and yet once I understood why it’ became so crystal clear

Comments

  1. In the openntf.domino API, you just use…

    doc.getItemValue("fieldName", Date.class)

    …because I despise method chaining. 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.