Timeformats for competitionTime and Product.startDateTime

Bug #599587 reported by sadam
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
TAC Energy
Confirmed
Medium
Unassigned

Bug Description

In addition to bug #599580 ( https://bugs.launchpad.net/tacenergy/+bug/599580 )

The time formats of competitionTime and Product.startDateTime are not the same, at least they are logged in different formats.
Logging says for example:
Mon Jun 28 22:00:00 CEST 2010 for CompetitionTime
2010-06-28 22:00:00.0 for Product.startDateTime

Would be no serious problem, but it might be the reason for the method Date.equals(Date) not to work properly. When trying to compare those Dates above equals(.) results in false.

Therefore, as in Bug #599580 (current-flag not set) I can't find out, if a product is consumed at the moment. Maybe exactly this leads to the bug with the current-flag.

Revision history for this message
sadam (melko-r) wrote :

Ok, I see, the Date.compareTo(Date) method does work in this case... (returns 0 for same time, -1/1 if date is in the past/future)
Still, different time formats are not useful here.
And I don't know, why equals(.) doesn't work....

Revision history for this message
John Collins (jcollins-cs) wrote :

Since this is intended to support an international competition, it seems reasonable to expect that all times are displayed/logged either in UT or elapsed time, not CEST or CDT or any other idiosyncratic format.

Revision history for this message
Carsten Block (cblock) wrote :

IMHO the real issue is the standard date and calendar API in Java, which is historically one of the weakest points in all JDKs to date. I would propose that we root out these problems by switching to http://joda-time.sourceforge.net/ using "LocalDate" data types, which are designed to be timezone unaware. A stable and readily usable joda time plugin exists for grails, which we could use.

Thoughts?

Changed in tacenergy:
importance: Undecided → Medium
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.