帝国cms7.5调用各类日期时间标签方式

时间:2024年06月03日

/

来源:网络

/

编辑:佚名

<table width="1000" border="0" cellpadding="0" cellspacing="0" align="center">
  <tr>
    <td valign="top">日榜:<br><a href="#"><?php echo date('Y年m月d日',strtotime('-6 day')) ?></a><br />
<a href="#"><?php echo date('Y年m月d日',strtotime('-5 day')) ?></a><br />
<a href="#"><?php echo date('Y年m月d日',strtotime('-4 day')) ?></a><br />
<a href="#"><?php echo date('Y年m月d日',strtotime('-3 day')) ?></a><br />
<a href="#"><?php echo date('Y年m月d日',strtotime('-2 day')) ?></a><br />
<a href="#"><?php echo date('Y年m月d日',strtotime('-1 day')) ?></a><br />
<a href="#"><?php echo date('Y年m月d日') ?></a></td>
    <td valign="top">周榜:<br>
        <a href="#"><?php echo date("Y年m月d日",mktime(0, 0 , 0,date("m"),date("d")-date("w")+1-7,date("Y"))); ?>-<?php echo date("Y年m月d日",mktime(23,59,59,date("m"),date("d")-date("w")+7-7,date("Y"))); ?></a><br>
        <a href="#"><?php echo date("Y年m月d日",mktime(0, 0 , 0,date("m"),date("d")-date("w")+1-14,date("Y"))); ?>-<?php echo date("Y年m月d日",mktime(23,59,59,date("m"),date("d")-date("w")+7-14,date("Y"))); ?></a><br>
        <a href="#"><?php echo date("Y年m月d日",mktime(0, 0 , 0,date("m"),date("d")-date("w")+1-21,date("Y"))); ?>-<?php echo date("Y年m月d日",mktime(23,59,59,date("m"),date("d")-date("w")+7-21,date("Y"))); ?></a><br>
        <a href="#"><?php echo date("Y年m月d日",mktime(0, 0 , 0,date("m"),date("d")-date("w")+1-28,date("Y"))); ?>-<?php echo date("Y年m月d日",mktime(23,59,59,date("m"),date("d")-date("w")+7-28,date("Y"))); ?></a><br>
        <a href="#"><?php echo date("Y年m月d日",mktime(0, 0 , 0,date("m"),date("d")-date("w")+1-28,date("Y"))); ?>-<?php echo date("Y年m月d日",mktime(23,59,59,date("m"),date("d")-date("w")+7-28,date("Y"))); ?></a><br>
        <a href="#"><?php echo date("Y年m月d日",mktime(0, 0 , 0,date("m"),date("d")-date("w")+1-35,date("Y"))); ?>-<?php echo date("Y年m月d日",mktime(23,59,59,date("m"),date("d")-date("w")+7-35,date("Y"))); ?></a><br>
        </td>
    <td valign="top">月榜:<br>
        <a href="#"><?php echo date("Y年m月d日",mktime(0, 0 , 0,date("m")-1,1,date("Y"))); ?>-<?php echo date("Y年m月d日",mktime(23,59,59,date("m") ,0,date("Y"))); ?></a><br>
        <a href="#"><?php echo date("Y年m月d日",mktime(0, 0 , 0,date("m")-2,1,date("Y"))); ?>-<?php echo date("Y年m月d日",mktime(23,59,59,date("m")-1 ,0,date("Y"))); ?></a><br>
        <a href="#"><?php echo date("Y年m月d日",mktime(0, 0 , 0,date("m")-3,1,date("Y"))); ?>-<?php echo date("Y年m月d日",mktime(23,59,59,date("m")-2 ,0,date("Y"))); ?></a><br>
        <a href="#"><?php echo date("Y年m月d日",mktime(0, 0 , 0,date("m")-4,1,date("Y"))); ?>-<?php echo date("Y年m月d日",mktime(23,59,59,date("m")-3 ,0,date("Y"))); ?></a><br>
        <a href="#"><?php echo date("Y年m月d日",mktime(0, 0 , 0,date("m")-5,1,date("Y"))); ?>-<?php echo date("Y年m月d日",mktime(23,59,59,date("m")-4 ,0,date("Y"))); ?></a><br>
        </td>
    <td valign="top">季榜:<br>
        <a href="#"><?php $season = ceil((date('n'))/3)-1; echo date('Y年m月d日', mktime(0, 0, 0,$season*3-3+1,1,date('Y'))); ?>-<?php echo date('Y年m月d日', mktime(23,59,59,$season*3,date('t',mktime(0, 0 , 0,$season*3,1,date("Y"))),date('Y'))); ?></a><br />
        <a href="#"><?php $season = ceil((date('n'))/3)-2; echo date('Y年m月d日', mktime(0, 0, 0,$season*3-3+1,1,date('Y'))); ?>-<?php echo date('Y年m月d日', mktime(23,59,59,$season*3,date('t',mktime(0, 0 , 0,$season*3,1,date("Y"))),date('Y'))); ?></a><br />
        <a href="#"><?php $season = ceil((date('n'))/3)-3; echo date('Y年m月d日', mktime(0, 0, 0,$season*3-3+1,1,date('Y'))); ?>-<?php echo date('Y年m月d日', mktime(23,59,59,$season*3,date('t',mktime(0, 0 , 0,$season*3,1,date("Y"))),date('Y'))); ?></a><br /></td>
  </tr>
</table>
案例效果:
猜你需要

豫ICP备2021026617号-1  豫公网安备:41172602000185   Copyright © 2021-2028 www.78moban.com/ All Rights Reserved

本站作品均来自互联网,转载目的在于传递更多信息,并不代表本站赞同其观点和对其真实性负责。如有侵犯您的版权,请联系 1565229909#qq.com(把#改成@),我们将立即处理。