-1

The date() function in php returns the current time and date, for example

date('l jS F');

would return

Tuesday 24 September

In a calendar app i'm buiding, I would like to display seven dates, starting from the current day: Tuesday 24 September, Wednesday 25 September, ... Monday 30 September

is there an easy way to do this with date()? If not, is it possible to somehow add one day to a date?

Thanks for help

user2807746
  • 121
  • 1
  • 1
  • 8

3 Answers3

1
date('l jS F', strtotime("+1 day"));
Naftali
  • 144,921
  • 39
  • 244
  • 303
0

Below code display tomorrow date

$date = date("l jS F", strtotime("tomorrow"));
echo $date;  
Vishnu
  • 2,372
  • 6
  • 36
  • 58
0

You could also use the DateTime class. today as 9/23

$date = new DateTime('tomorrow');

echo $date->format('m/d/Y'); # 09/24/2013

To set the time.

$date->setTime(12, 0 ,0);

echo $date->format('m/d/Y H:i:s'); # 09/24/2013 12:00:00

In your case.

echo $date->format('l jS F');
badllama77
  • 113
  • 2
  • 7