I found out that if you use this in your project in multiple places, meaning you have this php command executing in your code, they will clash with each other and throw your timestamps off and make your head spin. If you want to use this command in a separate file for some part of your project, do this in the new part of your code that you want a different timezone displayed or used and it wont interfere with your main datetime
// Store original timezone
$original_timezone = date_default_timezone_get();

// Set the new timezone to use in this block of project code
date_default_timezone_set('America/New_York'); // Change to fit your needs

// Execute the block of code that uses the new timezone
$local_time = date('M d, Y - g:i a');  // Adjust to what format you prefer
echo "<b>Local Server Time: </b>" . $local_time . "<br /><hr />"; // This is what I used it for, adjust accordingly.

// Restore the original timezone back to not interfere with other timezone functions
date_default_timezone_set($original_timezone);

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2023-04-12 21:25:11