PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
It can't be done with PHP. There's nothing communicated from the user's computer to the server to tell you their time or timezone. You can do it with Javascript, but that's a bit of a hassle and it won't work if the user has Javascript switched off.
You will have to know the user's timezone to do this. If you have the timezone you can set it using date_default_timezone_set() - http://www.php.net/manual/en/function.d ... ne-set.php, and the the date function will format it accordingly.
pytrin wrote:You will have to know the user's timezone to do this. If you have the timezone you can set it using date_default_timezone_set() - http://www.php.net/manual/en/function.d ... ne-set.php, and the the date function will format it accordingly.
@wwmmww In that regard.... it's usual practice to let customer set their timezone on registering and/or configure it whenever they want.... cause other means are just unreliable.
thats what i meant.. they have to set it in their profile / session whatever and in the php you enforce it using the function i mentioned. You don't expect that just setting it in the profile will have any effect?