In what scenarios would it be more appropriate to use server-side PHP code instead of client-side JavaScript for time-based functionalities on a webpage?

When dealing with time-based functionalities on a webpage that require accurate and secure time calculations, it is more appropriate to use server-side PHP code instead of client-side JavaScript. This is because PHP code runs on the server, ensuring consistent results across different client devices and preventing users from manipulating the time settings on their local machines.

<?php
// Server-side PHP code to get the current server time
$currentTime = date("Y-m-d H:i:s");

echo "Current server time: " . $currentTime;
?>