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
| Name | Data type | Default | Remarks |
|---|---|---|---|
| $dateTime | string | Date 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"