SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Feb 2006
    Posts
    257
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Counter including seconds

    Hi, I wonder if anyone can help.

    I wish to display a counter on my site that displays the number of minutes from a certain time and then counts upwards (displaying seconds as well as munites) to another time.

    For example:

    The counter should count 107 minutes and 30 seconds from 2pm onwards.

    The user logs onto the page at 2:13:09pm, so the counter already displays 13 minutes 09 seconds(13:09), then continues to count upwards until it reaches 107 minutes 30 seconds(107:30). At this point the clock should stop counting and just freeze.

    If the user logs onto the page before 2pm the clock should just display 00:00.

    The start time and amount of time to count are available as PHP variables on the page already. These values change most days though and so can not be hard coded.

    Does anyone have any idea how I could go about this?

    Thanks!

  2. #2
    SitePoint Addict jtrelfa's Avatar
    Join Date
    Oct 2004
    Location
    Troy, Mi
    Posts
    231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What do the PHP variables look like when you output them to the page? do you have a URL?
    var me = null;

  3. #3
    SitePoint Addict
    Join Date
    Feb 2006
    Posts
    257
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    At the moment the start time looks like 14:00 (time to start - 2pm)when printed to the screen, and the time to run for looks like 107:30 (time to run for - 107 mins 30 secs)


Bookmarks

Posting Permissions

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