Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 3 123 LastLast
Results 1 to 15 of 38
  1. #1
    New Coder
    Join Date
    Jun 2012
    Posts
    13
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Exclamation I would like a code/script that changes according to the time

    Here's my scenario:

    I'm going on a long distance bus trip up the North Island of New Zealand on 30th June 2012. My time table is below & I want to display something like Mark is in (name of the Town/City) on the Naked Bus.

    When I am between places I want to display something like
    Mark is between (Town/City I was just at) & (Town/City I will be in next) on the Naked Bus

    & if possible Mark will be in (Town/City I will be in next) in X minutes with 'X' being how many minutes to the next Town/City.


    TOWN/CITY ARRIVE DEPART
    Palmerston North Central 11.30am
    Feilding 12.00pm 12.00pm
    Hunterville 12.35pm 12.35pm
    Taihape 1.10pm 1.45pm
    Waiouru 2.10pm 2.10pm
    Turangi 2.50pm 2.50pm
    Taupo 3.45pm 4.25pm
    Tokoroa 5.20pm 5.20pm
    Putaruru 5.40pm 5.40pm
    Tirau 5.45pm 5.45pm
    Cambridge 6.05pm 6.05pm
    Hamilton Central 6.30pm 6.30pm
    Ngaruawahia 6.50pm 6.50pm
    Huntly 7.10pm 7.10pm
    Bombay Service Centre 7.40pm 7.40pm
    Manakau 7.50pm 7.50pm
    Auckland City Central 8.15pm


    I would appreciate someone sorting something like this out for me as I do not know a thing about codes & scripts. I would like it in JavaScript though.

    Once I know how the code/script is 'written' I can do the return trip back to Palmerston North (which will be on a different day & times will change).

    My email address is: webmaster@mark-wasley.exofire.net
    Please let me know when this is sorted, I really appreciate someone's help.

    Mark Wasley.

  • #2
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,576
    Thanks
    80
    Thanked 4,497 Times in 4,461 Posts
    Nice quote! Have to wonder how many people know who Lazarus Long is. Or will be. Or was. Or all of the above.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,576
    Thanks
    80
    Thanked 4,497 Times in 4,461 Posts
    You know, this isn't really very complex code. But one has to wonder if it is actually homework for a class. It doesn't seem to have much practical application. How many people are going to be following you on that trip? Why not just use Twitter and post a Tweet as you reach each station? Would surely be more effective than making the 2 or 3 people who are following you look at their browsers.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #5
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    Quote Originally Posted by Old Pedant View Post
    Nice quote! Have to wonder how many people know who Lazarus Long is. Or will be. Or was. Or all of the above.
    I don't know many Heinlein fans. Even fewer who have even heard of Lazarus Long. Sadly.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #6
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,576
    Thanks
    80
    Thanked 4,497 Times in 4,461 Posts
    Just noticed something. "Long distance bus trip."

    Perspective is everything, isn't it?

    Less than 8 hours of actual driving time. At what? Let's say 50 mile per hour (80 KPH).

    400 miles (640 KM).

    Here in USA, that's just a short jaunt. Long distance means over 1500 miles (2400 KM) or so.

    <grin/>
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #7
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,576
    Thanks
    80
    Thanked 4,497 Times in 4,461 Posts
    I grew up on Heinlein. If there's any of his later works I missed, I sure don't know what they are. <grin/>
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #8
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    Have you read the UNcut version of Stranger In A Strange Land?

    If not, highly recommended. Ginny had it published shortly after his demise. Read it side-by-side with the original published version and convinced the publisher to do it.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #9
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,576
    Thanks
    80
    Thanked 4,497 Times in 4,461 Posts
    Yes, purchased it 2 or 3 years ago. Amazing how things change in a few short years, no?
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #10
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    Same thing pretty much happened to Tolkein. "No one wants to read a book that thick; split it into three different books." Now you can purchase all three in one volume. Gah.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #11
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,576
    Thanks
    80
    Thanked 4,497 Times in 4,461 Posts
    LOL! Look at my post #6. Perspective is everything in more ways tham one.

    We think that modern people are so tied up in busy lives they don't have time to read, yet novels nowadays are longer than in prior times. Was reading "Under Heaven" by Guy Kay. That's surely a book that would have been split up in years past. Or look at how the size of the Harry Potter books compare to, say, the old Hardy Boy or Nancy Drew series. Even kids are reading more, it would seem.

    Maybe people (well some of us <grin/>) really are getting smarter.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #12
    Regular Coder
    Join Date
    Dec 2010
    Location
    Sheffield, UK
    Posts
    138
    Thanks
    81
    Thanked 1 Time in 1 Post
    Quote Originally Posted by Old Pedant View Post
    LOL! Look at my post #6. Perspective is everything in more ways tham one.

    We think that modern people are so tied up in busy lives they don't have time to read, yet novels nowadays are longer than in prior times. Was reading "Under Heaven" by Guy Kay. That's surely a book that would have been split up in years past. Or look at how the size of the Harry Potter books compare to, say, the old Hardy Boy or Nancy Drew series. Even kids are reading more, it would seem.

    Maybe people (well some of us <grin/>) really are getting smarter.
    Don't count on it. Bigger books are certainly no accurate measure of how "smart" people are: if anything just another by-product of societies where we have to have bigger portions of everything to satisfy our many delights - whether that be food or books. People - adults and children alike - are being dumbed down day by day, unfortunately.
    Last edited by Hashim1; 06-19-2012 at 01:04 AM.
    http://www.topcashback.co.uk/ref/hashim1

    ^
    Total earnings so far: £25.15
    A very generous cashback site worth checking out.


  • #13
    New Coder
    Join Date
    Jun 2012
    Posts
    13
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hi Everyone.

    I don't know anything about codes & scripts so I am really hoping for someone to help me with my scenario. I used the term 'long distance' so you'll know what I mean ... & so you would all know that I'm not talking about city buses in Palmerston North. I will be trying to post twitter messages so friends & family who visit my website will know 'LIVE' updates - I have put a link to my Twitter on my site. If someone helps me this time, then I'll know what to do next time I need something like this done ( & I can do it myself ).

    I look forward to hearing from anybody,

    Mark

  • #14
    New Coder
    Join Date
    Jun 2012
    Posts
    13
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question

    Quote Originally Posted by Old Pedant View Post
    You know, this isn't really very complex code. But one has to wonder if it is actually homework for a class. It doesn't seem to have much practical application. How many people are going to be following you on that trip? Why not just use Twitter and post a Tweet as you reach each station? Would surely be more effective than making the 2 or 3 people who are following you look at their browsers.
    Hi there,

    The code may not be complex but I do not know anything about codes & scripts so I came here hoping for some help.

    I will be trying to post twitter messages so friends & family who visit my website will know 'LIVE' updates - I have put a link to my Twitter on my site.

    If you (or anyone else) helps me this time, then I'll know what to do next time I need something like this done ( & I can do it myself ).

    Thankyou, Mark.

  • #15
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,983
    Thanks
    56
    Thanked 557 Times in 554 Posts
    much as I hate to interrupt a literary discussion, here is a little script that might help you get started:

    Code:
    <body>
    <div id="message"></div>	
    <script type="text/javascript">
    var now=new Date();
    if (now<new Date("Dec 25, 2013 06:00")){
    var mess="not time for presents yet";
    }else{
    var mess="open 'em up!";
    }
    document.getElementById("message").innerHTML=mess;
    </script>
    </body>


  •  
    Page 1 of 3 123 LastLast

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •