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!
Hello
I have a site which will display today's date. But the data center is located somewhere in US and the time zone in india is different (+5:30GMT) so the date shows some 10hrs behind. I can add the lost hrs but then the site would display the correct date in india only. How do I get this to show the correct date in any part of the world using their time zone ?
Anjanesh
You'll have to get the local time of the client via JavaScript and then feed that back to your PHP script which will remember it for them. Then of course just hope they've got their computer clock set correctly PHP itself cannot detect this.
There's no foolproof way to do that - say you reverse an IP to AOL - does that tell you where in the US they are for example? East coasters wouldn't have much use for west coast time zones (etc).