Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
go ahead... be a heretic
 
PerlMonks  

localtime and stuff

by Anonymous Monk
on Jun 14, 2002 at 15:30 UTC ( #174569=perlquestion: print w/ replies, xml ) Need Help??
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.

Comment on localtime and stuff
Download Code
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

      $mon-$mday-$year its displaying that.
        Sorry, I meant which date.

        --
        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".
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://174569]
Approved by grinder
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2014-04-18 03:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (460 votes), past polls