<th:block th:fragment="time(publishTime)"
          th:with="days=${(new java.util.Date().getTime()-publishTime.toEpochMilli())/86400000}">
    <th:block th:if="${days == 0}">
        <th:block th:with="minute=${(new java.util.Date().getTime()-publishTime.toEpochMilli())/60000}">
            <th:block th:if="${minute < 1}">
                [[${(new java.util.Date().getTime()-publishTime.toEpochMilli())/1000}+'秒前']]
            </th:block>
            <th:block th:if="${minute >= 1  && minute < 60 }">
                [[${minute}+'分钟前']]
            </th:block>
            <th:block th:if="${minute >= 60  && minute < 1440 }">
                <th:block>
                    [[${minute/60}+'小时前']]
                </th:block>
            </th:block>
        </th:block>
    </th:block>
    <th:block th:if="${days == 1}">
        昨天
    </th:block>
    <th:block th:if="${days <= 7 && days > 1}">
        [[${days}+'天前']]
    </th:block>
    <th:block th:if="${days > 7  }">
        [[${#dates.format(publishTime, 'yyyy年MM月dd日')}]]
    </th:block>
</th:block>