I'm trying to set a user's timezone offset for PHP, being sent over ajax. A page has been loaded with session data. If there is no data this gets put into the page:
<script type="text/javascript">
$(document).ready(function() {
var visitortime = new Date();
visitortime.setMonth(1);
var visitortimezone = visitortime.getTimezoneOffset()*60;
$.ajax({
url: "/ajax/timezone/set/"+ visitortimezone,
success: function(){
location.reload();
}
});
});
</script>
without the visitortime.setMonth(1);
it runs fine and returns the right offset. But with it, it returns only 0.
I want to be able to get timezone offset without DST and then run DST check on the PHP side.