/    Sign up×
Community /Pin to ProfileBookmark

Time Zone Script

Hello,

I am trying to fix this script to automatically detect what time Zone the user is in and post the corresponding time zones automatically instead of using the drop down menu that is provided. I would like to remove that option entirely. I’m having problems with it.

can anyone help?

Thanks!

[upl-file uuid=c2540d89-a7ff-4c91-9c51-0ff05ed20e25 size=6kB]Time_Zones_E.txt[/upl-file]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@James_GatkaFeb 01.2006 — Insert this code, where shown, just above the closing Script tag:
[CODE]
function getLocalOffset(){

var now = new Date();
var localGMToffset = now.getTimezoneOffset()/60*-1;
if (localGMToffset == -8){document.getElementById('LocalTimeZone').selectedIndex

= 1}
if (localGMToffset == -7){document.getElementById('LocalTimeZone').selectedIndex

= 2}
if (localGMToffset == -6){document.getElementById('LocalTimeZone').selectedIndex

= 3}
if (localGMToffset == -5){document.getElementById('LocalTimeZone').selectedIndex

= 4}
if (localGMToffset == -4){document.getElementById('LocalTimeZone').selectedIndex

= 5}
if (localGMToffset ==

-3.5){document.getElementById('LocalTimeZone').selectedIndex = 6}
showtime();
}

onload=getLocalOffset;

//-->
</SCRIPT>
</HEAD>
<BODY bgColor="#d7faff" topmargin="2">[/CODE]
Copy linkTweet thisAlerts:
@okanstauthorFeb 01.2006 — Thank you so much!!

Brilliant!! You are a life saver!!! ? ? ?
×

Success!

Help @okanst spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...