skip to Main Content

php time round up & round down

I am using the following function to round the time to closest 15 minutes. function roundTime($time){ $seconds = $time; $rounded_seconds = round($seconds / (15 * 60)) * (15 * 60); return date('H:i', $rounded_seconds) . "n"; } What I actually need…

VIEW QUESTION

PHP forach array with objects

How can I echo this PHP array with objects in an foreach loop? I want to echo each value in different parts of my code. array(2) { ["new_years_day"]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2024-01-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York"…

VIEW QUESTION
Back To Top
Search