如何获得一周中的第二天? [英] How do I get the next day of the week?

查看:120
本文介绍了如何获得一周中的第二天?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果今天是星期四,那么我想使用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)

这篇关于如何获得一周中的第二天?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆