<h2 data-line="0">时间格式化</h2> <p>基本语法</p> ~~~ {formatdate:[shijian],style} ~~~ <p>事例:</p> ~~~ {formatdate:[content:date],2} {formatdate:[content:date],yy-m-d} ~~~ <blockquote> <p>结果:2018-02-01</p> </blockquote> <table> <thead> <tr> <th>标签1</th> <th>标签2</th> <th>标签3</th> <th>结果</th> </tr> </thead> <tbody> <tr> <td>{formatdate:[shijian],0}</td> <td>{formatdate:[shijian],all}</td> <td>{formatdate:[shijian],yyyy-mm-dd hh:mn:ss}</td> <td>2018-02-01 10:30:59</td> </tr> <tr> <td>{formatdate:[shijian],1}</td> <td>{formatdate:[shijian],yy/m/d}</td> <td>{formatdate:[shijian],y/m/d}</td> <td>2018/02/01</td> </tr> <tr> <td>{formatdate:[shijian],2}</td> <td>{formatdate:[shijian],yy-m-d}</td> <td>{formatdate:[shijian],y-m-d}</td> <td>2018-02-01</td> </tr> <tr> <td>{formatdate:[shijian],3}</td> <td>{formatdate:[shijian],上午/下午 hh:mm:ss}</td> <td>{formatdate:[shijian],上午/下午 hh:mn:ss}</td> <td>上午 10:30:59</td> </tr> <tr> <td>{formatdate:[shijian],4}</td> <td>{formatdate:[shijian],hh:mm:ss}</td> <td>{formatdate:[shijian],h:m:s}</td> <td>10:30:59</td> </tr> <tr> <td>{formatdate:[shijian],5}</td> <td>{formatdate:[shijian],yyyy}</td> <td></td> <td>2018</td> </tr> <tr> <td>{formatdate:[shijian],6}</td> <td>{formatdate:[shijian],mm}</td> <td></td> <td>02</td> </tr> <tr> <td>{formatdate:[shijian],7}</td> <td>{formatdate:[shijian],dd}</td> <td></td> <td>01</td> </tr> <tr> <td>{formatdate:[shijian],8}</td> <td>{formatdate:[shijian],m-d}</td> <td></td> <td>02-01</td> </tr> <tr> <td>{formatdate:[shijian],9}</td> <td>{formatdate:[shijian],yyyymmddhhmnss}</td> <td></td> <td>20180101103059</td> </tr> <tr> <td>{formatdate:[shijian],10}</td> <td>{formatdate:[shijian],hh}</td> <td></td> <td>10</td> </tr> <tr> <td>{formatdate:[shijian],11}</td> <td>{formatdate:[shijian],mn}</td> <td></td> <td>30</td> </tr> <tr> <td>{formatdate:[shijian],12}</td> <td>{formatdate:[shijian],ss}</td> <td></td> <td>59</td> </tr> <tr> <td>{formatdate:[shijian],13}</td> <td>{formatdate:[shijian],yy-m}</td> <td>{formatdate:[shijian],y-m}</td> <td>2018-02</td> </tr> <tr> <td>{formatdate:[shijian],14}</td> <td>{formatdate:[shijian],enm}</td> <td></td> <td>Feb</td> </tr> <tr> <td>{formatdate:[shijian],15}</td> <td>{formatdate:[shijian],enmm}</td> <td></td> <td>February</td> </tr> <tr> <td>{formatdate:[shijian],16}</td> <td>{formatdate:[shijian],now}</td> <td></td> <td>1小时前</td> </tr> </tbody> </table> <hr> <p>[shijian] 对应时间标签如:[content:date][list][news:data]<br> style:对应时间样式:如1-12,yy-mm-dd等<br> style对应样式<br> 1或yy/m/d<br> &gt; 完整年月日</p> <p>2或yy-m-d<br> &gt; 完整年月日</p> <p>3或上午/下午 h:m:s<br> &gt; 完整年月日及时间</p> <p>4或h:m:s<br> &gt; 时间格式</p> <p>5或yyyy<br> &gt; 年</p> <p>6或mm<br> &gt; 月</p> <p>7或dd<br> &gt; 日</p> <p>8或m-d<br> &gt; 完整月日</p> <p>9或yyyymmddhhmnss<br> &gt; 完整年月日时间</p> <p>10或hh<br> &gt; 小时</p> <p>11或mn<br> &gt; 分钟</p> <p>12或ss<br> &gt; 秒</p> <p>13或yy-m<br> &gt; 年月</p> <p>14或enm<br> &gt; 英文简写月</p> <p>15或enmm<br> &gt; 英文月</p> <p>16或now<br> &gt;和现在的时间对比</p>