1Net::Time(3) User Contributed Perl Documentation Net::Time(3)
2
3
4
6 Net::Time - time and daytime network client interface
7
9 use Net::Time qw(inet_time inet_daytime);
10
11 print inet_time(); # use default host from Net::Config
12 print inet_time('localhost');
13 print inet_time('localhost', 'tcp');
14
15 print inet_daytime(); # use default host from Net::Config
16 print inet_daytime('localhost');
17 print inet_daytime('localhost', 'tcp');
18
20 "Net::Time" provides subroutines that obtain the time on a remote
21 machine.
22
23 Functions
24 "inet_time([$host[, $protocol[, $timeout]]])"
25 Obtain the time on $host, or some default host if $host is not
26 given or not defined, using the protocol as defined in RFC868. The
27 optional argument $protocol should define the protocol to use,
28 either "tcp" or "udp". The result will be a time value in the same
29 units as returned by time() or undef upon failure.
30
31 "inet_daytime([$host[, $protocol[, $timeout]]])"
32 Obtain the time on $host, or some default host if $host is not
33 given or not defined, using the protocol as defined in RFC867. The
34 optional argument $protocol should define the protocol to use,
35 either "tcp" or "udp". The result will be an ASCII string or undef
36 upon failure.
37
39 The following symbols are, or can be, exported by this module:
40
41 Default Exports
42 None.
43
44 Optional Exports
45 "inet_time", "inet_daytime".
46
47 Export Tags
48 None.
49
51 None.
52
54 Graham Barr <gbarr@pobox.com <mailto:gbarr@pobox.com>>.
55
56 Steve Hay <shay@cpan.org <mailto:shay@cpan.org>> is now maintaining
57 libnet as of version 1.22_02.
58
60 Copyright (C) 1995-2004 Graham Barr. All rights reserved.
61
62 Copyright (C) 2014, 2020 Steve Hay. All rights reserved.
63
65 This module is free software; you can redistribute it and/or modify it
66 under the same terms as Perl itself, i.e. under the terms of either the
67 GNU General Public License or the Artistic License, as specified in the
68 LICENCE file.
69
71 Version 3.13
72
74 23 Dec 2020
75
77 See the Changes file.
78
79
80
81perl v5.34.0 2021-07-27 Net::Time(3)