So I am trying to get the Last Modified date of a file in PHP, I am using this:
$file = "my_file.txt";
$date = date("F j, Y H:i:s.", filemtime($file));
Now the problem is when I echo it, I do not get it in my timezone. It comes up in UTC time, but I am in UTC-4 timezone.
(e1:) How do I get it to show my timezone, or even (e2:) display it in the timezone for whoever is viewing the webpage?
Example 1: Lets say I update the file at 1pm (UTC-4). Anyone looking at the webpage will see it displayed as 1pm (UTC-4) regardless of where they are located.
Example 2: Say I update the file at 1pm (UTC-4), and someone from the timezone UTC is looking at my webpage; they will see the time 5pm (UTC), because that's the time I uploaded it in their timezone.