tag:blogger.com,1999:blog-12172455.post3499712492182141861..comments2019-09-03T06:04:53.646-07:00Comments on JeoFTP: Determine the Java TimeZone of your web visitors using client-side javascriptAnonymoushttp://www.blogger.com/profile/15580776653929196013noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-12172455.post-16362270691722613162019-09-03T06:04:53.646-07:002019-09-03T06:04:53.646-07:00// fixes the mentioned bug ("GMT+-2:00")...<br />// fixes the mentioned bug ("GMT+-2:00") with positive timezones: "GMT+02:00".<br /><br />function getTimezone() {<br /> var tzo = new Date().getTimezoneOffset(); //returns timezone offset in minutes<br /> function pad(num, digits) {<br /> num = String(num); while (num.length < digits) { num="0"+num; }; return num;<br /> }<br /> return "GMT" + (tzo > 0 ? "-" : "+") + pad(Math.floor(Math.abs(tzo)/60), 2) + ":" + pad(Math.abs(tzo)%60, 2);<br />}<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-12172455.post-82015185286966675022013-07-08T11:19:06.303-07:002013-07-08T11:19:06.303-07:00for +04:00 etc with +
you should put something li...for +04:00 etc with + <br />you should put something like num=abs(num)Anonymoushttps://www.blogger.com/profile/05723300322177583976noreply@blogger.comtag:blogger.com,1999:blog-12172455.post-91605396581240543672011-03-17T23:49:07.706-07:002011-03-17T23:49:07.706-07:00thanks, was helpfulthanks, was helpfulAnonymousnoreply@blogger.com