Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      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

        1. TAJO-825_1.patch
          355 kB
          Hyoungjun Kim
        2. TAJO-825_2.patch
          357 kB
          Hyoungjun Kim
        3. TAJO-825_3.patch
          357 kB
          Hyoungjun Kim
        4. TAJO-825.patch
          355 kB
          Hyoungjun Kim

          Issue Links

            Activity

              People

              • Assignee:
                hjkim Hyoungjun Kim
                Reporter:
                hjkim Hyoungjun Kim
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: