Results 1 to 5 of 5

Thread: thinger in javascript?

  1. #1

    Thread Starter
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,390

    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

  2. #2
    Frenzied Member TomGibbons's Avatar
    Join Date
    Feb 2002
    Location
    San Diego, CA Previous Location: UK
    Posts
    1,345
    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.

  3. #3
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    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.

  4. #4

    Thread Starter
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,390
    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 ...

  5. #5

    Thread Starter
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,390
    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
  •  



Click Here to Expand Forum to Full Width