#!/usr/bin/perl use strict; use warnings; use Net::NTP; use Time::HiRes qw( gettimeofday ); my ($seconds, $microseconds) = gettimeofday; my %response = get_ntp_response("0.se.pool.ntp.org",123); my $localHostTime = $seconds . "." . $microseconds; my $offSet = $localHostTime - $response{'Reference Timestamp'}; print "This is what I want: ".$response{'Offset'}."\n"; print "This is what I get: ".$offSet."\n"; __END__ This is what I want: -0.00841593742370605 This is what I get: 1687.41735005379