My web host runs on PDT, while I am on EDT. This causes problems when recording time stamps to files, etc.
In a thread below, I picked up a few pointers and ended up with code like this to add 3 hours to the local PDT on the server:
$new_time = date("H:i", mktime(date("H", time()) + $value));
I extracted this from the following code that was sent to me (which does not compile):
$time = date("g:i A", mktime(date("g", time()) + 3, date("i", time()), date("s", time()), date("n", time()), date("d", time()), date("Y", time()));
So if the local time is, say, 10:30, this returns the correct time as 13:30.
This works fine. But what happens when it's 21:10 PDT? Adding 3 hours for EDT makes this 01:10 EDT. But this only updates the hour, not the day. So I may think it's 01:10 Saturday, but all I've done is end up with 01:10 Friday because the week day for PDT is still Friday, not Saturday!
Question is, how can I also update the weekday, not just the hour? This implies, of course, knowing that I've crossed the midnight point. Isn't there some way to add 10,800 seconds (3 hours) to the local PDT time and let UNIX convert the whole thing to the corrected time, day, weekday, month, and year (if necessary)?
Seems to me this should be pretty simple, but I don't know what the solution is.