while (<FHIN>) { ## takes each line and sends it through $line=$_; ## remove the new line chomp(); ## we have to convert the line into an array to change ## the timestamp to local time ## so using the split command it splits the line by the ## commas (,) and assigns it the variable $line @line = split(/,/ ,$line); ## takes the first value of the array $line, which is $line[0] and we are going to convert the time stamp ## using the localtime function print @line[0]; ## declare the variable $t= @line[0]; print "this is what t is now $t\n"; ## assign the format ($s,$m,$h,$md,$mon,$year) = localtime($t); ## increment mon by one because in unix time months start from 0-11 not 1-12 $mon++; ## add 1900 to the year because unix time starts the year 2000 at 100 ## took the format and put it into a readable and useable format $firstnum = "$mon/$md/$year $h:$m:$s"; my $firstnumtest = "$mon$md$year";

Originally posted as a Categorized Question.


In reply to [untitled node, ID 39551] by fgcr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.