Hi list,

I would like to re-surface the date format problem that's affecting
jasperreports integration for at least 5 months.

This problem is the cause of at least 3 opened issues:

http://issues.opennms.org/browse/NMS-5404
http://issues.opennms.org/browse/NMS-5379
http://issues.opennms.org/browse/NMS-5457

And makes the affected reports totally unusable for anyone not using
english locales.

After analysis, the problem seems to be that Java's SimpleDateFormat is
locale dependent while Postgresql's isn't (see
http://www.postgresql.org/docs/8.3/static/datetime-appendix.html. More
precisely, http://www.postgresql.org/docs/8.3/static/datetime-keywords.html)

So, in jasperreports' templates, all "EEE MMM d HH:mm:ss Z yyyy" date
formats translate to something localized (eg: "Lun Juil 17 13:22:05 +002
2012") that postgresql doesn't understand (because "Lun" (Monday in French)
and "Juil" (July in French) binary-search table lookups (see
http://www.postgresql.org/docs/8.3/static/datetime-input-rules.html) don't
succeed).

In current openNMS source code, there are *14 such instances of this date
format in only 32 jrxml files*!

>From what I've read, it seems that using "yyyy-MM-d HH:mm:ss Z" (ISO 8601)
would be *much more appropriate*; From
http://www.postgresql.org/docs/8.1/static/datatype-datetime.html :

*"Date and time input is accepted in almost any reasonable format,
including ISO 8601, SQL-compatible, traditional POSTGRES, and others"*

and:

*Table 8-10. Date Input*
* ** *  *Example* *Description*   *January 8, 1999* *unambiguous in any
datestyle input mode*  *1999-01-08* *ISO 8601; January 8 in any mode
(recommended
format)*  *1/8/1999* *January 8 in MDY mode; August 1 in DMY mode*  *
1/18/1999* *January 18 in MDY mode; rejected in other modes*
*01/02/03* *January
2, 2003 in MDY mode; February 1, 2003 in DMY mode; February 3, 2001 in YMDmode
*  *1999-Jan-08* *January 8 in any mode*  *Jan-08-1999* *January 8 in any
mode*  *08-Jan-1999* *January 8 in any mode*  *99-Jan-08* *January 8
in YMDmode, else error
*  *08-Jan-99* *January 8, except error in YMD mode*  *Jan-08-99* *January
8, except error in YMD mode*  *19990108* *ISO 8601; January 8, 1999 in any
mode*  *990108* *ISO 8601; January 8, 1999 in any mode*  *1999.008* *year
and day of year*  *J2451187* *Julian day*  *January 8, 99 BC* *year 99
before the Common Era*
If you like, I've attached to this email a patch that fixes 10 of these
date format instances (I'm not sure the 4 remaining instances need to be
fixed).

I hope my patch will agree you, and that you will find the time to commit
it anytime soon.

best regards,

Cyrille

Attachment: 0001-Fix-to-the-jasperreports-integration-date-format.patch
Description: Binary data

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this 
page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel

Reply via email to