On 2012-09-27 17:16, Chris Stinemetz wrote:
I have the following millisecond value: 54599684
This represents a timestamp reported as milliseconds past midnight local time.
Is there a module to convert this into a hh::mm format? Or a Perlish
example to handle this?
Variants:
perl -we '
my $t0 = time;
$t0 -= $t0 % 86400; # midnight
my $t = $ARGV[0] / 1000; # seconds
printf "%02d:%02d:%02d\n", $t/3600, $t/60%60, $t%60;
printf "%02d:%02d:%02d\n", (gmtime $t0+$t)[2,1,0];
' 54599684
15:09:59
15:09:59
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/