값을 standard locale 포맷에 맞게 변환

${#calendars.format(cal)}

${#calendars.arrayFormat(calArray)}

${#calendars.listFormat(calList)}

${#calendars.setFormat(calSet)} Sat Apr 14 02:22:32 KST 2018 -> 2018년 4월 14일 (토) 오전 2시 19분 15초

값을 ISO8601 포맷으로 변환

${#calendars.formatISO(cal)}

${#calendars.arrayFormatISO(calArray)}

${#calendars.listFormatISO(calList)}

${#calendars.setFormatISO(calSet)} Sat Apr 14 02:22:32 KST 2018 -> 2018-04-14T02:24:31.342+09:00

값을 지정된 포맷으로 변환

${#calendars.format(cal, 'dd/MMM/yyyy HH:mm')}

${#calendars.arrayFormat(calArray, 'dd/MMM/yyyy HH:mm')}

${#calendars.listFormat(calList, 'dd/MMM/yyyy HH:mm')}

${#calendars.setFormat(calSet, 'dd/MMM/yyyy HH:mm')} Sat Apr 14 02:22:32 KST 2018 -> 14/4월/2018 02:27

calendar 객체의 특정 요소값

${#calendars.day(date)} // also arrayDay(...), listDay(...), etc.

${#calendars.month(date)} // also arrayMonth(...), listMonth(...), etc.

${#calendars.monthName(date)} // also arrayMonthName(...), listMonthName(...), etc. ${#calendars.monthNameShort(date)} // also arrayMonthNameShort(...), listMonthNameShort(...), etc. ${#calendars.year(date)} // also arrayYear(...), listYear(...), etc. ${#calendars.dayOfWeek(date)} // also arrayDayOfWeek(...), listDayOfWeek(...), etc.

${#calendars.dayOfWeekName(date)} // also arrayDayOfWeekName(...), listDayOfWeekName(...), etc. ${#calendars.dayOfWeekNameShort(date)} // also arrayDayOfWeekNameShort(...), listDayOfWeekNameShort(...), etc. ${#calendars.hour(date)} // also arrayHour(...), listHour(...), etc.

${#calendars.minute(date)} // also arrayMinute(...), listMinute(...), etc.

${#calendars.second(date)} // also arraySecond(...), listSecond(...), etc.

${#calendars.millisecond(date)} // also arrayMillisecond(...), listMillisecond(...), etc.

Sat Apr 14 02:22:32 KST 2018 -> 4

Sat Apr 14 02:22:32 KST 2018 -> 14

Sat Apr 14 02:22:32 KST 2018 -> 4월

Sat Apr 14 02:22:32 KST 2018 -> 2018

calendar 객체 생성

현재 시간과 날짜로 calendar객체 생성

${#calendars.createNow()}

${#calendars.createNowForTimeZone()}

${#calendars.createToday()} //시간은 0:00으로 셋팅

${#calendars.createTodayForTimeZone()} //시간은 0:00으로 셋팅

${#calendars.create(year,month,day)}

${#calendars.create(year,month,day,hour,minute)}

${#calendars.create(year,month,day,hour,minute,second)} ${#calendars.create(year,month,day,hour,minute,second,millisecond)} ${#calendars.createForTimeZone(year,month,day,timeZone)} ${#calendars.createForTimeZone(year,month,day,hour,minute,timeZone)} ${#calendars.createForTimeZone(year,month,day,hour,minute,second,timeZone)} ${#calendars.createForTimeZone(year,month,day,hour,minute,second,millisecond,timeZone)}

'개발 > Thymeleaf' 카테고리의 다른 글

Thymeleaf date 문법  (0) 2020.03.27
Thymeleaf number 문법  (0) 2020.03.27
Thymeleaf string 문법  (0) 2020.03.27
Thymeleaf 기본 문법  (0) 2020.03.27