xref: /netbsd-src/external/mpl/bind/dist/bin/tests/system/dnssec/ntadiff.pl (revision 4d342c046e3288fb5a1edcd33cfec48c41c80664)
1#!/usr/bin/perl -w
2#
3# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
4#
5# This Source Code Form is subject to the terms of the Mozilla Public
6# License, v. 2.0. If a copy of the MPL was not distributed with this
7# file, You can obtain one at http://mozilla.org/MPL/2.0/.
8#
9# See the COPYRIGHT file distributed with this work for additional
10# information regarding copyright ownership.
11
12use strict;
13use Time::Piece;
14use Time::Seconds;
15
16exit 1 if (scalar(@ARGV) != 2);
17
18my $actual = Time::Piece->strptime($ARGV[0], '%d-%b-%Y %H:%M:%S.000 %z');
19my $expected = Time::Piece->strptime($ARGV[1], '%s') + ONE_WEEK;
20my $diff = abs($actual - $expected);
21
22print($diff . "\n");
23