You can insert an exclamation into the DateTime::createFromFormat
method to reset all of the remaining time units
1// 2021-10-12 21:48:07.02DateTime::createFromFormat('Y-m-d', '2021-10-12');3 4// 2021-10-12 00:00:00.05DateTime::createFromFormat('!Y-m-d', '2021-10-12');6 72021-10-12 21:00:00.08DateTime::createFromFormat('!Y-m-d H', '2021-10-12');
Tip given by @SteveTheBauman