I am using DateTimePicker to have the user enter a date. The way dates work in my industry is YYYYMM. This should represent the last day of the month. For example 201307 should equal 2013-07-31 which was the last day of July. But the code below shows 2013-07-01, the first day of the month.
<form method="post">
<?php
DateTimePicker::create(array(
"name" => "datePicker",
"maxDate" => "@endDatePicker",
"format" => "YYYYMM",
"themeBase" => "bs4",
));
?>
<button type="submit">Submit</button>
</form>
<?php
if (!empty($_POST["datePicker"])) {
$timestamp= strtotime($_POST["datePicker"]);
echo gmdate("Y-m-d", $timestamp);
}
?>
Is there some way I can cause DatePicker to use the last day of the month?