Given any unix timestamp, I want to get the midnight timestamp to T.
This timestamp can be any integer: now, today (not too far []) in the future or (not too far []) in the past.
Is there a cleaner path (pseudocode):
<?php $midnight = strtotime("{date('d',$ts)}-{date('m',$ts)}-{date('Y', $ts)} midnight"); ?>
Thanks.
[*] somewhere between 1990 and 2020.
source share