Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
use Carbon\CarbonImmutable;
// First quarter:
$now = (new CarbonImmutable('2025-02-28'));
printf("Day: %s\nNext quarter: %s\n\n", $now->format('Y-m-d'), $now->addQuarter()->startOfQuarter()->format('Y-m-d'));
// Second quarter:
$now = (new CarbonImmutable('2025-04-01'));
printf("Day: %s\nNext quarter: %s\n\n", $now->format('Y-m-d'), $now->addQuarter()->startOfQuarter()->format('Y-m-d'));
// Third quarter:
$now = (new CarbonImmutable('2025-07-01'));
printf("Day: %s\nNext quarter: %s\n\n", $now->format('Y-m-d'), $now->addQuarter()->startOfQuarter()->format('Y-m-d'));
// Fourth quarter (next year):
$now = (new CarbonImmutable('2025-10-28'));
printf("Day: %s\nNext quarter: %s\n\n", $now->format('Y-m-d'), $now->addQuarter()->startOfQuarter()->format('Y-m-d'));