You can do this with the strtotime function.
To do all day, I like to edit the timestamp. These are the designations of the seconds from the era. One day is 86400 seconds, so if you do the following caculation:
$time = $time - ( $time % 86400 );
You can convert it back to date using the PHP date function, for example:
$readableFormat = date( 'dm-Y', $time );
There is also a lot of internet in this section.
source share