Thread: timestamps

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    456
    Rep Power
    15
    ($atime, $mtime) = (stat($path))[8,9];

    $mtime now contains some huge number of seconds somehow relating to when the file specified by $path was last modified. How can I take $mtime and format it to MONTH DAY, YEAR?

    Thanks!

    [This message has been edited by scream (edited July 19, 2000).]
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    300
    Rep Power
    15
    Try using something like localtime(). Chek the man pages for further info.
  4. #3
  5. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    Try the following..Modify as per your requirment..


    ($sec,$min,$hour,$mday,$mon,$year,$wday) = localtime($mtime);

    @months = ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");

    $year = $year + 1900;
    $date = "$months[$mon]- $mday - $year";

    print $date;

    -----------------


    ------------------
    SR -
    webshiju.com

    "The fear of the LORD is the beginning of knowledge..."

IMN logo majestic logo threadwatch logo seochat tools logo