|
-
Apr 15th, 2004, 04:21 AM
#1
thinger in javascript?
ok... how can i do something like this in javascript??
thinger = "ljsdf sdf +qihsasdf asfhkasdfg"
thinger = Strings.Mid(thinger, InStr(thinger, "+"))
thinger = Strings.Mid(thinger, 1, InStr(thinger, " ") - 1)
... and yes i have my reasons
thanks
kris
-
Apr 15th, 2004, 04:58 AM
#2
Frenzied Member
Code:
var thinger = "ljsdf sdf +qihsasdf asfhkasdfg";
thinger = thinger.substr(thinger.indexOf('+');
thinger = thinger.substr(thinger.indexOf(' ') - 1, 1);
Is that what you mean? Not really getting you here.
-
Apr 15th, 2004, 08:18 AM
#3
Frenzied Member
substr(point,length)
or
substring(point,other_point)
I use the 2nd a lot more, from a certain point to another one.
Have I helped you? Please Rate my posts. 
-
Apr 16th, 2004, 04:06 AM
#4
no... actually i meant
<script language="JavaScript">
today = new Date();
var thinger = today.toString();
thinger = thinger.substr(thinger.indexOf('UTC'));
thinger = thinger.substr(3, thinger.indexOf(' ')-3);
document.write(thinger);
</script>
... but u're code was good .. i could work out how 2 adapt in in bout 1 min 
... and as u can c i have used it to return the users time zone ...
-
Apr 16th, 2004, 06:14 PM
#5
hmmm ... found a page:
http://www.w3schools.com/js/js_datetime.asp
on witch i found a nice little thing : getTimezoneOffset
so now this does the same thing :
<script language="JavaScript">
var d = new Date()
document.write((0 - d.getTimezoneOffset())/60);
</script>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|