Grall, are you talking about using a timestamp in your program on your server? If you use PHP in a webpage on your server and use the “date” or “time” or “strtotime” functions, you will ALWAYS get the SERVER’s timezone?
You can try to pull the client’s timezone, but, not all server’s will pull the clients timezone.
Usually, you have to do that on the browser or CLIENT-SIDE as the server is not usually the same as the user’s location.
If you need to use the time from the client’s system, you can do that with Javascript and pull it from their local machine. You can do that when they log in and save it in your database with a time difference so when they display time functions, you can adjust the time for them.
So, if they post something and you timestamp it and they are in a different timezone, the wrong time will be posted. When displayed back, it will be off up to 3 hours in the US.
SOLUTIONS: So, now that I have said all that… You can solve this by two ways. You can have the user enter their timezone when they register and adjust the time using their setting. (There are date/time functions in PHP to do this.) Or, instead of having them involved, you can store a “local zone cookie” on their system and read the data back in PHP to find the difference in time from your server to their local machine and use that difference when displaying times on their computer… Here is a quote I found on another site about this:
Sometimes, there's not a server-based/PHP method for getting local time. You have to get it from the client via Javascript. Google "bitbucket timezone detect" and use it to set a "local_timezone" cookie that you can read from PHP and set via date_default_timezone_set()
Hope some of that info helps you...