Joda DateTime Project 3/4

Partial

날짜 또는 시간으로 나누어 표현한다.

  • LocalDate - timezone, time 없는 date.
  • LocalTime - timezone, date 없는 time.
  • LocalDateTime - timezone 없는 datetime.
  • YearMonth -  년과 월,  카드 만료일에 사용하기 좋음
  • MonthDay - 월과 일, 생일에 사용하기 좋음
  • Partial
  • YearMonthDay - @Deprecated
  • TimeOfDay - @Deprecated


사용 예)
/** Create the Partials  */
logger.info("\n\n ========== Create the LocalDate and LocalTime ===========");
LocalDate localDate = new LocalDate();
LocalTime localTime = new LocalTime();
logger.info("localDate and localTime {}, {}", localDate, localTime); 
/** return 2012-08-01, 12:47:33.575 */
YearMonth yearMonth = new YearMonth();
MonthDay monthDay = new MonthDay();
logger.info("yearMonth is {}", yearMonth);  // return 2012-08
logger.info("monthDay is {}", monthDay);  // return --08-01

Referred from http://joda-time.sourceforge.net 버젼 2.1

댓글

가장 많이 본 글