Page 1 of 1

Getting client date/time in php

Posted: Wed Aug 31, 2005 8:12 am
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

Posted: Wed Aug 31, 2005 8:22 am
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.

Posted: Wed Aug 31, 2005 9:32 am
by fuxia79
I used javascript and achieved my goal. :D
Thanks for the super-speedy reply