http://qs321.pair.com?node_id=174569

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

foreach my $file (@userfiles) { my $size = format_size(-s "$user{site_id}/$file"); $mtime = (stat("$user{site_id}"))[9]; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = (localtime +($mtime)); $year += 1900; print qq~ <tr> <td bgcolor="#FFFFFF" align="center" width="25"> <input type="radio" name="select" value="file"> </td> <td bgcolor="#FFFFFF" align="center" width="175"> <font face="verdana" color="black" size="1"><a href="http:// +www.webewebin.com/home/$user{'site_id'}/$file">$file</a> </td> <td bgcolor="#FFFFFF" align="center"> <font face="verdana" color="black" size="1"> $size</font> </td> <td bgcolor="#FFFFFF" align="center"> <font face="verdana" color="black" size="1">$mon-$mday-$year +</font> </td> </tr> ~; }
for some reason if I was to upload a dile to this direcotry, foreach file it would print the day that I upload it, not the original day foreach.

Replies are listed 'Best First'.
Re: localtime and stuff
by Abigail-II (Bishop) on Jun 14, 2002 at 15:39 UTC
    Well, if you upload the file, the file is modified (not on the system it came from, but certainly on the system it went to). And I guess that's the time you're getting.

    Abigail

      I see wat=ht I did wrong OI was stating the directory lol
Re: localtime and stuff
by marvell (Pilgrim) on Jun 14, 2002 at 15:34 UTC
    Sorry for missing the point, but what date would you like to be displayed?

    --
    Steve Marvell

      when marvell asked "what date would you like" i believe he meant "what time relative to the lifespan of the file" not "read me the code you just posted".
      $mon-$mday-$year its displaying that.
        Sorry, I meant which date.

        --
        Steve Marvell