Net::Time - time and daytime network client interface
use Net::Time qw(inet_time inet_daytime);
print inet_time(); # use default host from Net::Config
print inet_time('localhost');
print inet_time('localhost', 'tcp');
print inet_daytime(); # use default host from Net::Config
print inet_daytime('localhost');
print inet_daytime('localhost', 'tcp');
Net::Time
provides subroutines that obtain the time on a remote machine.
inet_time([$host[, $protocol[, $timeout]]])
Obtain the time on $host
, or some default host if $host
is not given or not defined, using the protocol as defined in RFC868. The optional argument $protocol
should define the protocol to use, either tcp
or udp
. The result will be a time value in the same units as returned by time() or undef upon failure.
inet_daytime([$host[, $protocol[, $timeout]]])
Obtain the time on $host
, or some default host if $host
is not given or not defined, using the protocol as defined in RFC867. The optional argument $protocol
should define the protocol to use, either tcp
or udp
. The result will be an ASCII string or undef upon failure.
The following symbols are, or can be, exported by this module:
None.
Graham Barr <gbarr@pobox.com>.
Steve Hay <shay@cpan.org> is now maintaining libnet as of version 1.22_02.
Copyright (C) 1995-2004 Graham Barr. All rights reserved.
Copyright (C) 2014, 2020 Steve Hay. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself, i.e. under the terms of either the GNU General Public License or the Artistic License, as specified in the LICENCE file.
Version 3.14
23 Dec 2020
See the Changes file.