Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jun 2010
    Location
    Sutton-in-ashfield, Notts
    Posts
    117
    Thanks
    7
    Thanked 0 Times in 0 Posts

    date format help.

    Anyone know what's up with this?
    PHP Code:
    <?php
        $days 
    floor($posts['timestamp'] / (60 60 24));
        
    $remainder $posts['timestamp'] % (60 60 24);
        
    $hours floor($remainder / (60 60));
        
    $remainder $remainder % (60 60);
        
    $minutes floor($remainder 60);
        
    $seconds $remainder 60;
                
        if(
    $days 0) {
        echo 
    date("d/m/y"$posts['timestamp']);
        echo 
    " at ";
        echo 
    date("H:i"$posts['timestamp']);
        }elseif(
    $days == && $hours == && $minutes == 0) {
        echo 
    "few seconds ago";
        }elseif(
    $days == && $hours == 0) {
        echo 
    $minutes.' minutes ago';
        }elseif(
    $days == && $hours 0){
        echo 
    $hours.' hour ago';
        }else{
        echo 
    "few seconds ago";
        }
        
    ?>

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    It returns

    Code:
    few seconds ago
    Anything else you want me to run for ya?

  • #3
    Regular Coder
    Join Date
    Jun 2010
    Location
    Sutton-in-ashfield, Notts
    Posts
    117
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Fumigator View Post
    It returns

    Code:
    few seconds ago
    Anything else you want me to run for ya?
    I know & i need to get it fixed lol you know how to fix it?

  • #4
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    It's doing just what it says to do.

  • #5
    Regular Coder
    Join Date
    Jun 2010
    Location
    Sutton-in-ashfield, Notts
    Posts
    117
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Fixed it....

    Thanks anyway.


  •  

    Posting Permissions

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