Getting client date/time in php

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!

Moderator: General Moderators

Post Reply
fuxia79
Forum Newbie
Posts: 3
Joined: Wed Jul 06, 2005 4:00 am

Getting client date/time in php

Post by fuxia79 »

Hi all, I am using php with smarty and I display the server time using $smarty.now.
My question is: is it somewhat possible to get the time of the client instead of getting the server's one? I searched the universe but found no reply!
Thanks in advance
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you'll need Javascript to tell you what time their machine thinks it is, or allow them to set what time they use. The first does not involve PHP almost at all, while the second requires adjusting the server's time to their time-offsets.
fuxia79
Forum Newbie
Posts: 3
Joined: Wed Jul 06, 2005 4:00 am

Post by fuxia79 »

I used javascript and achieved my goal. :D
Thanks for the super-speedy reply
Post Reply