How can change time in timestamp to 00:00:00

Here is acode with which I get the earliest date:

$minmax = get_min_max_dates($user_id);
foreach ($minmax as $ckey=>$cval){
$min_date = $cval['startDate'];
$max_date = $cval['endDate'];
echo "min_date: ".$min_date."<br/>";

Here is the result:
min_date: 2017-08-14 07:20:36

I want to change this timestamp in $min_date variable to 2017-08-14 00:00:0
(midnight of same day.

All I can find il how to display the date in various ways or add / subtruct yaer / month / daty ect…

How do I do it? How do I change time in variable to 00:00:00 ?

Explode the value on the space character, then concatenate the new ending onto the date part.

0:00 is different everywhere in the world. So be careful handling dates with time and don’t forget to think about timezones…

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.