- time: documentation ( source)
- date: documentation ( source)
- strtotime: documentation ( source)
<?php
echo date("H:i:s Y-m-d", time());
echo "\n";
$time = time();
echo date("H:i:s Y-m-d",(date('w', $time) == 0) ? $time : strtotime('last sunday', $time));