sub msqtime2perl { # MicroSoft QuadTime to Perl my $foo = shift; my ($high,$low) = map { $foo->{ $_ } } qw(HighPart LowPart); return unless $high and $low; return ((unpack("L",pack("L",$low)) + unpack("L",pack("L",$high)) * (2 ** 32))) / 10000000) - 11644473600; } if ( $userObject->{lastLogon} and $userObject->{lastLogon}->{HighPart} ) { $epochtime = msqtime2perl( $userObject->{lastLogon} ); }