datetime - Guardian Digital WebTool module interface to the system date and time.
use datetime; my $time = new datetime;
This Guardian Digital WebTool module provides an interface to manipulating the system date and time. This module allows you to manage the system NTP servers, set the system locale/timezone, and set the system date and time.
This contructor instantiates a new datetime object, which contains the NTP configuration and the zone configuration.
Example Usage:
my $time = new datetime;
my $ntp1 = $time->{'ntp_config'}->{'server'}->[0];
my $ntp2 = $time->{'ntp_config'}->{'server'}->[1];
my $ntp3 = $time->{'ntp_config'}->{'server'}->[2];
my $region = $time->{'zone_config'}->{'region'}
my $area = $time->{'zone_config'}->{'area'}
This function is used to set all three ntp servers in configuration file. It receives three server names as argument, then it updates /etc/ntp/ntp.conf. It also writes all server names in /etc/ntp/step-tickers too.
Example Usage:
$time->set_ntp_servers($server1, $server2, $server3);
This function sets the system time according to given argument. Hash reference containing values of month,day,year,hour,minute,second is received as argument.
Example Usage:
$time->set_system_time({
'month' => $month,
'day' => $day,
'year' => $year,
'hour' => $hour,
'minute' => $minute,
'second' => $second,
});
Ryan W. Maple <ryan@guardiandigital.com>
Copyright 2000-2007 Guardian Digital, Inc., All Rights Reserved