값을 standard locale 포맷에 맞게 변환

${#dates.format(cal)}

${#dates.arrayFormat(calArray)}

${#dates.listFormat(calList)}

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

값을 ISO8601 포맷에 맞게 변환

${#dates.formatISO(cal)}

${#dates.arrayFormatISO(calArray)}

${#dates.listFormatISO(calList)}

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

값을 지정된 포맷에 맞게 변환

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

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

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

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

dates 객체의 특정 요소값

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

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

${#dates.monthName(date)} // also arrayMonthName(...), listMonthName(...), etc.

${#dates.monthNameShort(date)} // also arrayMonthNameShort(...), listMonthNameShort(...), etc.

${#dates.year(date)} // also arrayYear(...), listYear(...), etc.

${#dates.dayOfWeek(date)} // also arrayDayOfWeek(...), listDayOfWeek(...), etc.

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

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

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

${#dates.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

dates 객체 생성

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

${#dates.createNow()}

${#dates.createNowForTimeZone()}

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

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

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

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

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

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

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

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