如何获得一周中的第二天?

编程入门 行业动态 更新时间:2024-10-27 06:31:39
本文介绍了如何获得一周中的第二天?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 如果今天是星期四,那么我想使用php date()函数显示星期五。 例如,以下代码将显示当前月份,但将显示本月的第二天。有效。 <?php echo date(M),date(d)+ 1?>

所以我试图通过这个<?php echo date(l)+ 1,date(d)+ 1?> ,它愚弄了我:(。

解决方案

下面的表达式给你第二天:

date('l',time()+ 3600 * 24)

Like if today is Thursday, then I want to display Friday using php date() function. For example, the below code will show the current month but the next day of the month. It worked. <?php echo date("M "), date("d")+1 ?>

So I was trying through this one <?php echo date("l")+1, date("d")+1 ?> and it fooled me :(.

解决方案

The following expression gives you the next day:

date('l', time()+3600*24)

更多推荐

如何获得一周中的第二天?

本文发布于:2023-11-24 02:54:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1623711.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:第二天   如何获得

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!