/    Sign up×
Community /Pin to ProfileBookmark

alterration of time in script

Hello
Gilbert Davis was kind enough to write this script on this Fourm a couple of years ago

  • 1. the script changes a image at a set time and then changes back at set time again..
    the current scipt changes at 8.00pm then backat 5.00am next day.
    I am tying to change image at 8.30pm and with help of a mate tryed a couple adjustment but to no avail, changes on time but doesnt change back.
  • this orginal script
    </br>

    [code=php]</br><script>
    function changePerTime() {
    var now = new Date();
    var aussieTime = (now.getUTCHours() + 11) % 24; // 10 hr from GMT
    if ((aussieTime >= 20) || (aussieTime <= 4)) // 9pm to 5am
    {document.weather.src = “webcam.jpg”}
    else
    {document.weather.src = “webcam32.jpg”}
    setTimeout(“changePerTime()”, 5*60*1000) // check every 5 minutes
    }
    </script></br>[code=php]</br>

    on
    URL=http://www.bayviewbakery.com.au]http://www.bayviewbakery.com.au[/URL]

    and our first try on [url]http://www.jervisbaytourism.com/test_weather_cam.html[/url]
    br>[code=php]</br>

    <script>
    function changePerTime() {
    var now = new Date();
    var aussieTime = (now.getUTCHours() + 11) % 24; // 10 hr from GMT
    var aussieMinute = now.getUTCMinutes();

    if ((aussieHour >= 20) || (aussieMinute > = 30) || (aussieHour <= 4)) // 8pm to 5am
    {document.weather.src = “webcam.jpg”}
    else
    {document.weather.src = “webcam32.jpg”}
    setTimeout(“changePerTime()”, 5*60*1000) // check every 5 minutes
    }
    </script>
    </br>[code=php]</br>

    and our 2nd try test on [url]http://www.jervisbaytourism.com/test_weather.html[/url]
    </br>[code=php]</br>
    <script>
    function changePerTime() {
    var now = new Date();
    var aussieTime = (now.getUTCHours() + 11) % 24; // 10 hr from GMT
    var aussieMinute = now.getUTCMinutes();

    if ((aussieHour >= 20) || (aussieMinute = 30) || (aussieHour <= 4)) // 8pm to 5am
    {document.weather.src = “jervis_bay/forecast/1moon.gif”}
    else
    {document.weather.src = “jervis_bay/forecast/1.gif”}
    setTimeout(“changePerTime()”, 5*60*1000) // check every 5 minutes
    }
    </script>
    </br>[code=php]</br>
    Any help would be most appreicated
    Regards
    Don

    to post a comment
    JavaScript

    3 Comments(s)

    Copy linkTweet thisAlerts:
    @PittimannFeb 01.2004 — Hi!

    Please try something like this in the line setting the image src for the night:

    if ((aussieTime == 20&&aussieMinute>=30)||(aussieTime > 20)||(aussieTime <= 4)) // 8.30pm to 5am

    That should do it...

    Cheers - Pit
    Copy linkTweet thisAlerts:
    @1954authorFeb 03.2004 — My aplogise for the delay in answering your post Pittiman

    Only had chance to test this morning

    your solution

    if ((aussieTime == 20&&aussieMinute>=30)||(aussieTime > 20)||(aussieTime <= 4)) // 8.30pm to 5am

    makes it work perfectly, thank you

    Your help is much appreciated

    Regards

    Don
    Copy linkTweet thisAlerts:
    @PittimannFeb 03.2004 — Hi!

    No need to apologize ? - you're welcome!

    Btw - very nice images on your site!

    Cheers - Pit
    ×

    Success!

    Help @1954 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 6.18,
    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: @nearjob,
    tipped: article
    amount: 1000 SATS,

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

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,
    )...