Skip to content

时间处理

时间格式

html
<hlx-template
  component-type="news"
  component-query-option="{'newsId':''}"
  component-variable="article"
></hlx-template>

<span
  class="detail-info-item-value"
  th:text="${#dates.format(article.pubTime, 'yyyy/MM/dd')}"
>
</span>

年月日

html
th:text="${item.pubTime.substring(0, 10)}"
html
<div class="day" th:text="${item.pubTime.substring(8, 10)}">13</div>

<span class="month" th:text="${item.pubTime.substring(5, 7)}">10</span>

<span th:text="${item.pubTime.substring(0, 4)}">06</span>