Java
DateFormatSymbols
weekdays
, shortWeekdays
의 0번째 인덱스는 비어있다.
import java.text.DateFormatSymbols
arrayOf(Locale.KOREAN, Locale.ENGLISH).forEach {
val symbols = DateFormatSymbols.getInstance(it)
println("months : ${symbols.months.joinToString(", ")}")
println("shortMonths : ${symbols.shortMonths.joinToString(", ")}")
println("weekdays : ${symbols.weekdays.joinToString(", ")}")
println("shortWeekdays: ${symbols.shortWeekdays.joinToString(", ")}")
println("amPmStrings : ${symbols.amPmStrings.joinToString(", ")}")
println("amPmStrings : ${symbols.zoneStrings.joinToString(", ")}")
}
결과
months : 1월, 2월, 3월, 4월, 5월, 6월, 7월, 8월, 9월, 10월, 11월, 12월
shortMonths : 1월, 2월, 3월, 4월, 5월, 6월, 7월, 8월, 9월, 10월, 11월, 12월
weekdays : , 일요일, 월요일, 화요일, 수요일, 목요일, 금요일, 토요일
shortWeekdays: , 일, 월, 화, 수, 목, 금, 토
amPmStrings : 오전, 오후
months : January, February, March, April, May, June, July, August, September, October, November, December
shortMonths : Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec
weekdays : , Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
shortWeekdays: , Sun, Mon, Tue, Wed, Thu, Fri, Sat
amPmStrings : AM, PM
Joda
Duration 객체를 이용한 기간
- Days:
Duration(it.startDate, it.endDate).toStandardDays().days
- Hours:
Duration(it.startDate, it.endDate).toStandardHours().hours