note
chargrill
<c>
$ perl -e 'print localtime( 1138597506 ). "\n"'
Sun Jan 29 23:05:06 2006
$perl -e 'print join " ", localtime( 1138597506 ), "\n"'
6 5 23 29 0 106 0 28 0
</c>
<p>In scalar context, passing your value to <c>localtime</c> will give you a nice textual representation. In list context, it gives you a list you can format on your own, with the values being Seconds, Minutes, Hours, (0 based) Day of Month, (0 based) Month, Year (minus 1900), (0 based) Day of Week, (0 based) Day of Year, and whether or not it is in DST.</p>
<p>Or something like that. <c>perldoc -f localtime</c> will correct any inaccuracies :)</p>
<p><b>Update:</b> I read too fast. [ikegami]'s right on the money. Excerpted from <c>perldoc Time::Local</c>:</p>
<p><blockquote>
These routines are the inverse of built-in perl functions localtime()
and gmtime(). They accept a date as a six-element array, and return
the corresponding time(2) value in seconds since the system epoch (Mid-
night, January 1, 1970 GMT on Unix, for example). This value can be
positive or negative, though POSIX only requires support for positive
values, so dates before the system's epoch may not work on all operat-
ing systems.
</blockquote></p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-474411">
<br><br>
--chargrill
<hr>
<font size=2>
<code>
s**lil*; $*=join'',sort split q**; s;.*;grr; &&s+(.(.)).+$2$1+; $; =
qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)
</code>
</font>
</div></div>
599055
599055