Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
None
Description
Currently Tajo uses Joda time library for Datetime related features.
I tested Joda library with a next test code. It is difficult to express various time range with Joda library.
So I propose that Tajo uses PostgreSQL style date/time features. I already migrated PostgreSQL's date/time code to Tajo. I will attach that patch soon.
Calendar cal = Calendar.getInstance(); cal.set(Calendar.YEAR, 1582); cal.set(Calendar.MONTH, 9); cal.set(Calendar.DAY_OF_MONTH, 14); SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); DateTime defaultCalDate = new DateTime(1582, 10, 14, 10, 0, 0, 0); Chronology julianChrono = JulianChronology.getInstance(); DateTime julianCalDate = new DateTime(1582, 10, 14, 10, 0, 0, 0, julianChrono); System.out.println("Java Calendar :" + df.format(cal.getTime())); System.out.println("ISO Calendar : " + defaultCalDate); System.out.println("Julian Calendar: " + julianCalDate); System.out.println("ISO Calendar's dayOfWeek: " + defaultCalDate.getDayOfWeek()); System.out.println("Julian Calendar's dayOfWeek: " + julianCalDate.getDayOfWeek()); System.out.println("ISO Calendar's getCenturyOfEra: " + defaultCalDate.getCenturyOfEra()); System.out.println("Julian Calendar's getCenturyOfEra: " + julianCalDate.getCenturyOfEra());
Java Calendar :1582-10-24 16:49:35 ISO Calendar : 1582-10-14T10:00:00.000+08:27:52 Julian Calendar: 1582-10-14T10:00:00.000+08:27:52 ISO Calendar's dayOfWeek: 4 Julian Calendar's dayOfWeek: 7 ISO Calendar's getYearOfCentury: 15 Julian Calendar's getYearOfCentury: 16
Attachments
Attachments
Issue Links
- breaks
-
TAJO-2110 Fix incorrect DateTime and remove hard coded tests
- Resolved