帝国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>
案例效果:
<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>
案例效果:
新闻资讯 更多
- 【帝国cms教程】帝国cms7.5调用各类日期时间标签方式06-03
- 【帝国cms教程】帝国cms灵动标签里调用系统扩展变量06-03
- 【帝国cms教程】帝国cms封面模板调用当前栏目下的子栏目名称及子栏目的子栏目名称信息展示/三级分类06-03
- 【帝国cms教程】帝国cms如何自动生成缩略图自动下载远程图设置选区第一张图为缩略图06-03
- 【帝国cms教程】帝国cms灵动标签中价格折扣的计算方式06-02
- 【帝国cms教程】帝国CMS在下载内容页downpath字段显示下载点数06-02
- 【帝国cms教程】帝国CMS模板制作:用灵动标签调用导航,栏目设置是否显示不起作用06-02
- 【帝国cms教程】帝国cms头部模板导航栏目显示代码,显示二级栏目下拉菜单带样式判断06-02
热门文章
- 178Moban源码谈谈免费源码与收费源码的区别
- 2帝国CMS忘记后台登陆用户名、密码、认证码的解决方法
- 3帝国CMS(EmpireCMS) v7.5后台任意代码执行漏洞及具体修复方法
- 4帝国CMS和WordPress 哪个好?哪个适合建站?
- 5如何解决Discuz的密码错误次数过多请15分钟后登陆的问题
- 6帝国cms灵动标签取得内容和栏目链接地址
- 7emlog pro 注册码“开心”教程(如果有一天,emlog官方版 或者 emlog免费版 跑路了,那用户怎么办?)
- 8帝国cms后台登录出现”您还未登录”怎么解决?
- 9织梦CMS在nginx下设置伪静态方法(附nginx伪静态规则)
- 10帝国cms7.5忘记登录密码 和忘记登录认证码以及多次登录 失败被锁定解决办法