Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2009
    Location
    Hull
    Posts
    827
    Tokens
    0

    Latest Awards:

    Default Timer like facebook?

    Hi,

    Does anyone know how to make a timer like facebooks where it says "2 minutes ago" & "1 hour ago" etc...

    +REP for any hel

    Lew.
    Im not here to be loved, I love to be hated :-}


  2. #2
    Join Date
    Feb 2006
    Location
    Scotland
    Posts
    2,087
    Tokens
    138

    Latest Awards:

    Default

    If you save the time that the action is done at, then compare it against the current time and finally round the time - you would have a similar sort of idea

    http://stackoverflow.com/questions/2...nearest-minute

  3. #3
    Join Date
    Jun 2008
    Location
    United Kingdom
    Posts
    2,015
    Tokens
    568

    Latest Awards:


  4. #4
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    Save the timestamp.. (<?php $time = time(); ?>), then use a relative time function available almost anywhere.. (just Google around) to do it... be aware of timezones also if you've got a script used across many times zones.

  5. #5
    Join Date
    Sep 2009
    Location
    Hull
    Posts
    827
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Dentafrice View Post
    Save the timestamp.. (<?php $time = time(); ?>), then use a relative time function available almost anywhere.. (just Google around) to do it... be aware of timezones also if you've got a script used across many times zones.
    Ta. Thats exactly what I've done. Im making a staff intranet for working, just thought it would be useful to know when jobs were added

    Mod close thread. kthnx.

    Lew.
    Im not here to be loved, I love to be hated :-}


Posting Permissions

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