[ 
https://issues.apache.org/jira/browse/TAJO-825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13996607#comment-13996607
 ] 

Hyunsik Choi edited comment on TAJO-825 at 5/13/14 4:46 PM:
------------------------------------------------------------

In addition, this patch includes the source code originated form postgresql. 
So, we need to change NOTICE file.


was (Author: hyunsik):
In addition, this patch includes the part originated form postgresql. So, we 
need to change NOTICE file.

> Datetime type refactoring.
> --------------------------
>
>                 Key: TAJO-825
>                 URL: https://issues.apache.org/jira/browse/TAJO-825
>             Project: Tajo
>          Issue Type: Improvement
>            Reporter: Hyoungjun Kim
>            Assignee: Hyoungjun Kim
>         Attachments: TAJO-825.patch
>
>
> 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.
> {code}
> 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());
> {code}
> {noformat}
> 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
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to