phlocbg / phloc-datetime

Automatically exported from code.google.com/p/phloc-datetime
0 stars 0 forks source link

Format date to Peppol BIS Billing 3.0 format. #1

Closed dantam74 closed 5 years ago

dantam74 commented 5 years ago

Hi!

I've successfully used your library ph-ubl21 to create working BIS 3.0 invoices :-)

However, I have one tiny problem. In your example you're using PDTXMLConverter to set dates in the invoice. If I for instance write this code

XMLGregorianCalendar dueDate = PDTXMLConverter.getXMLCalendar(src.getDueDate()); dueDate.setTimezone(0); dst.setDueDate(dueDate);

The date is represented as below

<cbc:DueDate>2019-05-01Z</cbc:DueDate>

How do I get rid of the timezone Z? It's not allowed in the validators I use (https://sfti.validex.net)

Is there a timezone component in XMLGregorianCalendar that can be cleared or is it something in the ph-ubl21 library?

Thanks :-)

dantam74 commented 5 years ago

dueDate.setTimezone(javax.xml.datatype.DatatypeConstants.FIELD_UNDEFINED);

did the trick :-)