Excel, handily, presents time as 18:00 but holds it internally as a decimal portion of 24 hours e.g. 0.75 . This code converts the decimal fractionback to 24 hour time
my $frac = shift; my $hour = ($frac * 24) % 24; my $minute = (($frac * 24) - $hour) * 60; my $time = sprintf "%.2d:%.2d", $hour, $minute;

Replies are listed 'Best First'.
Re: Excel time to hh:mm
by jmcnamara (Monsignor) on May 23, 2002 at 09:41 UTC

    For the other side of the coin this module has a collection of routines that convert dates and times into the decimal format required by Excel.

    --
    John.