Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Formatting time

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 446
    Comment on it

    Some time you may need to find the day, hour and min and seconds for ex:

    *you entered a number 105
    and you want 1h-45Min ago*
    

    then you can simply use the following function although you can use your custom function as well depends on the need.

    Function call:

    $wt =105;
    getWaitingTime($wt);
    

    Function Definition:

    public function getWaitingTime($wt) {    
                   $hour = intval(gmdate("i", $wt)).'h-';
          if($hour==0)
                $hour = '';
          $min  = intval(gmdate("s", $wt)).'Min';
          if($min==0)
              $hour = '';
          return $hour.$min. ago.;
    }
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: