www.webdeveloper.com
Results 1 to 5 of 5

Thread: how to compare the timing?

  1. #1
    Join Date
    Sep 2008
    Posts
    62

    how to compare the timing?

    Hi guys,

    I am working on my tv guide website that I output the data to my php from mysql database. I want to know how i can work it out the tv time for per programme how long they would last for, e.g 30 mins, 1 hour...etc

    PHP Code:
    <html>

    <body>

    <style type="text/css">

    #channel1 {

        position:absolute;

        font-family:Arial;

        font-size:29px;

        font-style:normal;

        font-weight:bold;

        color:f5fdfd;

        text-decoration:none;

        text-transform:none;

        visibility:visible;

        overflow:hidden;

        left:35px; top:245px; width:176px; height:50px;

        z-index:1;

    }

    #programme1 {

        position:absolute;

        font-family:Arial;

        font-size:29px;

        font-style:normal;

        font-weight:bold;

        color:f5fdfd;

        text-decoration:none;

        text-transform:none;

        visibility:visible;

        overflow:hidden;

        left:427px; top:245px; width:176px; height:50px;

        z-index:1;

    }

    #programme2 {

        position:absolute;

        font-family:Arial;

        font-size:29px;

        font-style:normal;

        font-weight:bold;

        color:f5fdfd;

        text-decoration:none;

        text-transform:none;

        visibility:visible;

        overflow:hidden;

        left:765px; top:245px; width:176px; height:50px;

        z-index:1;

    }

    #programme3 {

        position:absolute;

        font-family:Arial;

        font-size:29px;

        font-style:normal;

        font-weight:bold;

        color:f5fdfd;

        text-decoration:none;

        text-transform:none;

        visibility:visible;

        overflow:hidden;

        left:1110px; top:245px; width:176px; height:50px;

        z-index:1;

    }

    #day {

        font-family:Arial;

        font-size:29px;

        font-style:normal;

        font-weight:bold;

        color:f5fdfd;

        text-decoration:none;

        text-transform:none;

        position:absolute;

        visibility:visible;

        overflow:hidden;

        left:294px; top:180px; width:176px; height:50px;

        z-index:0;

    }

    #time1 {

        font-family:Arial;

        font-size:29px;

        font-style:normal;

        font-weight:bold;

        color:f5fdfd;

        text-decoration:none;

        text-transform:none;

        position:absolute;

        visibility:visible;

        overflow:hidden;

        left:424px; top:180px; width:176px; height:50px;

        z-index:0;

    }

    #time2 {

        font-family:Arial;

        font-size:29px;

        font-style:normal;

        font-weight:bold;

        color:f5fdfd;

        text-decoration:none;

        text-transform:none;

        position:absolute;

        visibility:visible;

        overflow:hidden;

        left:754px; top:180px; width:176px; height:50px;

        z-index:0;

    }

    #time3 {

        font-family:Arial;

        font-size:29px;

        font-style:normal;

        font-weight:bold;

        color:f5fdfd;

        text-decoration:none;

        text-transform:none;

        position:absolute;

        visibility:visible;

        overflow:hidden;

        left:1104px; top:180px; width:176px; height:50px;

        z-index:0;

    }

    <?php

    include("get-listing.php");

    ?>

    <div id="image1" style="position:absolute; overflow:hidden; visibility:visible; left:21px; top:245px; width:374px; height:40px; z-index:0"><img src="/images/row1_yellow.jpg" alt="" title="" border=0 width=374 height=50></div>

    <div id="image2" style="position:absolute; overflow:hidden; visibility:visible; left:21px; top:295px; width:374px; height:40px; z-index:0"><img src="/images/row1.jpg" alt="" title="" border=0 width=374 height=50></div>

    <div id="image3" style="position:absolute; overflow:hidden; visibility:visible; left:21px; top:345px; width:374px; height:40px; z-index:0"><img src="/images/row1.jpg" alt="" title="" border=0 width=374 height=50></div>

    </body>

    </html>
    I am using the row1 as per image to resize it for per programme, but i have no idea how i can compare with each timing for per programme before resizing on per image.

    here is what my php displaying:

    Code:
    <span id='time1'>1:00 PM</span> - <span id='title1'>SportsCenter</span><br></br><span id='time2'>2:00 PM</span> - <span id='title2'>SportsCenter</span><br></br><span id='time3'>3:00 PM</span> - <span id='title3'>SportsCenter Special: On the Clock</span><br></br><span id='time4'>4:00 PM</span> - <span id='title4'>NFL Live</span><br></br>

    I want to know how to work it out on per timing how long the programme will last for, e.g I want to work it out between time1 and time2 to find out how long it will last which it make 60 mins.

    Does anyone know how i can compare with each timing on per programme before resizing on per image?

    Any advice would be much appreicated.

    Thanks in advance

  2. #2
    Join Date
    Sep 2008
    Posts
    62
    48 hours and no one is replying. does anyone know??????????

  3. #3
    Join Date
    Jan 2009
    Posts
    3,346
    Are you just looking to see the number of minutes between 2 times?

  4. #4
    Join Date
    Sep 2008
    Posts
    62
    Yes, that is what I am looking for. Could you post the code that i can work out between 2 times using with the tag before i could resize on each image??

  5. #5
    Join Date
    Jan 2009
    Posts
    3,346
    I would probably use some combination of strtotime and/or DateTime:diff.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles