Is it possible on a web server to determine the users local time and timezone when they sent the request?
Could it be done using javascript to capture it and post it back to the server?
My company want to track how many users use our site outside of office hours (no I dont really know why either!).
Thanks.
You need to put the client's JavaScript time into a hidden field, and assume their clock is set properly.
myTime = new Date() >> Tue Feb 03 2009 12:24:28 GMT-0500 (Eastern Standard Time)
You could load a date into a hidden field using JavaScript:
var newDate = new Date();
hiddenFieldName.value = newDate.toLocaleString();
Then on the postback to the sever grab that field.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With