0

I'm trying to exclude a specific period from the date I'm going to print. I tried but without success.

The code I'm trying is this but not print anything and give me blank page:

$get_st_date = "2020-08-01";
$get_end_date = "2020-08-30";
$resultDelDate = strftime('%A %d %B', strtotime("+15 weekday"));
$get_period = new DatePeriod($get_st_date, $resultDelDate, $get_end_date);
echo $resultDelDate;

How can i do? Thanks!

Jackom
  • 384
  • 3
  • 16
  • If you're going to work with Dates a lot, you should really give [Carbon](https://carbon.nesbot.com/docs/) a try. I usually don't recommend packages or plugins as solutions, which is why I wrote this suggestion as a comment, but this plugin has proved itself useful to me countless times in the past. – guychouk Jul 23 '20 at 07:27
  • *but it doesn't work* what doesn't work? – Nigel Ren Jul 23 '20 at 07:29
  • not print the date and give me blank page :) – Jackom Jul 23 '20 at 07:31
  • `var_dump($resultDelDate);` should tell you more about whats happening – Pavel Janicek Jul 23 '20 at 07:59
  • Unfortunately nothing returns :( – Jackom Jul 23 '20 at 08:05
  • Fatal error: Uncaught Exception: DatePeriod::__construct(): This constructor accepts either (DateTimeInterface, DateInterval, int) OR (DateTimeInterface, DateInterval, DateTime) OR (string) as arguments - you can debug this [here](https://3v4l.org/20tmr) – Pavel Janicek Jul 23 '20 at 08:52
  • What I would like to do is add the days to the current date, however, skipping a date range. How else can I do? – Jackom Jul 23 '20 at 08:54

0 Answers0