sub getTime{ my ($filetimepointer) = @_; my $systemtime = pack("SSSSSSSS",0,0,0,0,0,0,0,0); my $FileToSystem = new Win32::API ("kernel32", "FileTimeToSystemTime", ['P','P'] , 'I'); $FileToSystem->Call($filetimepointer,$systemtime); my($year,$month,$wday,$day,$hour,$minute,$second,$msecond) = unpack("SSSSSSSS",$systemtime); return ($year,$month,$wday,$day,$hour,$minute,$second,$msecond); } sub printtime { my $time= shift; my ($year,$month,$wday,$day,$hour,$minute,$second,$msecond)= getTime (time); $second += $msecond/1000; print "$year-$month-$day $hour:$minute:$second\n"; }