How To Get The Current Time/timezone Of The User Visiting My Website?
I am working on an application which utilizes PHP (Zend Framework) and JavaScript (jQuery). I'm trying to get the current time of the user visiting the site. Is this possible? How
Solution 1:
adapted from: http://kennyshu.blogspot.com/2009/05/javascript-get-clients-timezone.html
<scripttype="text/javascript">var gmtOffset
functiontimezone()
{
var localTime = newDate();
//this one will give you the GMT offset
gmtOffset = localTime.getTimezoneOffset()/60 * (-1);
}
</script>
then post back the variable gmtOffset to your application.
Post a Comment for "How To Get The Current Time/timezone Of The User Visiting My Website?"