Skip to main content
Version: Fegg 5.x (next)

Date::getTheLastday

Get the last day of the month

Description​

public string Date::getTheLastday( string $dateTime )

Returns the last day of the month of $dateTime as a 2-digit string.

Arguments​

NameData typeDefaultRemarks
$dateTimestringDate in the target month

Example​

Controller
use Fegg\Tool\Date;

$date = new Date();

echo $date->getTheLastday('2024-02-10'); // -> "29"
echo $date->getTheLastday('2024/04'); // -> "30"