in reply to Re: Converting to GPS time
in thread Converting to GPS time

Hi Harry,

Thanks for the help.

The reason the 15 seconds was not a burning issue is that I just needed a script to access particular directories (they had been set up by someone else in the distant past), which contained the gps data. The directories themselves were set up by GPS week, but then there was overlap between weeks anyway. There was lots of duplication as you can imagine.

Replies are listed 'Best First'.
Re^3: Converting to GPS time
by mrdvt92 (Acolyte) on Mar 06, 2011 at 00:20 UTC

    You can calculate the GPS leap second offset with DateTime::LeapSecond.

    perl -e 'use lib qw{lib}; use DateTime::LeapSecond; print DateTime::LeapSecond::leap_seconds( (DateTime->now->utc_rd_value +s)[0] ) - DateTime::LeapSecond::leap_seconds( (DateTime->new(qw{year 1980 +month 1 day 6 time_zone UTC})->utc_rd_values)[0]), "\n";'