ONMS in "fr" and "de" locales: all event times end in hh:mm:00 (no seconds)

Description

Hi,

I have been noticing this for a long time now (1.3+) and today looked up bugzilla and discussion list, but didn't found anything:

I use ONMS on a Windows 2003 5.2 (x86) server and all event times have 00 seconds

posgres shows

opennms=# select eventtime, eventcreatetime from events where eventid = 3527001;

eventtime | eventcreatetime
------------------------+---------------------------- 2009-03-05 14:48:00+01 | 2009-03-05 14:48:22.606+01
(1 row)

opennms=#

I use postgres 8.2.5

Any idea?

Thanks

Mark

Environment

Operating System: Windows XP/2003 (NT 5.1) Platform: PC

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Seth Leger February 16, 2012 at 3:45 PM

After testing various locales, I tracked this issue down to the fact that DateFormat.FULL in "fr" and "de" locales drop the seconds value completely in that format. I've added a special case to the EventConstants class so that it will use DateFormat.LONG for French and German locales (LONG does include the seconds field). All other locales retain their seconds values in DateFormat.FULL.

I added opennms-model/src/test/java/org/opennms/netmgt/DateFormatLocaleTest.java to test each locale for this bad behavior. If you have problems in additional locales, please add the locales to this unit test to verify how they behave.

Marking as fixed.

commit fde787994db64f883e4ae248aaee1f0859ce4a06
commit 21f26beb2fd47cdb8f1f6d5aed6ac20488acb175

Michael November 16, 2010 at 11:39 AM

more affected versions/systems from questions in the mailing list

OpenNMS 1.8.5, installed on a Ubuntu 10.10 Kernel 2.6.35-22-server
centos5
OpenNMS 1.8.3, installed on a Solaris10

Philippe Guillebert August 12, 2009 at 8:51 AM

I just hit this one. System was configured for french (fr_FR.utf8).

I changed the locale to en_US.utf8 in the postgresql.conf AND system-wide (/etc/sysconfig/i18n) and rebooted and it fixed it.

Fixed

Details

Assignee

Reporter

Labels

Components

Fix versions

Affects versions

Priority

PagerDuty

Created March 5, 2009 at 10:52 AM
Updated January 27, 2017 at 4:26 PM
Resolved February 16, 2012 at 3:45 PM