my $tz = ManaTools::Shared::TimeZone->new();
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
optional parameter to set the system timezone directory, default value is /usr/share/zoneinfo
optional parameter to set the ntp server configuration file, it meant to be for testing purpose, do not set or it will be considered as configuration file despite of what the ntp service is.
optional parameter to set ntp configuration directory, default value is /etc/ntp
optional parameter to set the ntp program that runs into the system, available value are chronyd, ntpd and systemd-timesyncd. Default value is evaluate by configuration file found in the system, fallback choice is systemd-timesyncd.
This RO attribute is a HashRef containing managed ntp service as key and related configuration file. Allowed actions: getNTPServiceConfig => retrieves config file from the given ntp service ntpServiceConfigPairs => Key,Value pairs access
This attribute is a ArrayRef containing the sorted list of configured NTP service into the system, retrieving info from services.
To inform the back-end that is working during installer or livecd. Useful if Time zone setting and using fix_system to use the real time clock (see setLocalRTC and writeConfiguration).
Refresh the ntpServiceList attribute value, usefull if any NTP service has been istalled after having instantiated this object
timezone_prefix: directory in which time zone files are
$from_system: if present and its value is not 0 checks into timezone_prefix directory and gets the list from there
@l: ARRAY containing sorted time zones
This method returns the available timezones
$new_time_zone: New time zone to be set
This method get the new time zone to set and performs the setting
$timezone: current time zone
This method returns the current timezone setting
$enable: bool value enable/disable real time clock as localtime $fix_system: bool read or not the real time clock
This method enables/disables the real time clock as localtime (e.g. disable means set the rtc to UTC). NOTE from dbus: Use SetLocalRTC() to control whether the RTC is in local time or UTC. It is strongly recommended to maintain the RTC in UTC. Some OSes (Windows) however maintain the RTC in local time which might make it necessary to enable this feature. However, this creates various problems as daylight changes might be missed. If fix_system is passed "true" the time from the RTC is read again and the system clock adjusted according to the new setting. If fix_system is passed "false" the system time is written to the RTC taking the new setting into account. Use fix_system=true in installers and livecds where the RTC is probably more reliable than the system time. Use fix_system=false in configuration UIs that are run during normal operation and where the system clock is probably more reliable than the RTC.
$localRTC: 1 if RTC is localtime 0 for UTC
This method returns the RTC localtime setting
$enable: enable/disable systemd NTP service
This method enables/disables and starts/stops systemd NTP service,
$NTP: if systemd NTP is enabled
This method returns the systemd NTP service is running
$sec_since_epoch: Time in seconds since 1/1/1970
This method set the system time and sets the RTC also
hash reference containing: UTC => HW clock is set as UTC ZONE => Time Zone set
This method returns the time zone system settings as hash reference
$info: hash containing: UTC => HW clock is set as UTC ZONE => Time Zone
This method sets the passed Time Zone configuration. If installer_or_livecd attribute is set fix_system is passed to setLocalRTC
HASHREF containing ntp_server => zone info
This method returns an hash ref containing pairs ntp-server, zone
@servers: array of configured server
Returns the current ntp server address list read from configuration file
Returns the current ntp service
This method just returns if the given ntp server is running
$NTP_servers: HASH reference containing: servers => Array reference containing NTP server addresses pool => ntp pool address if any
This method writes into NTP configuration file new server address settings (note that root rights are required) or it rises an exception
$server: server address to be configured
This method writes into NTP configuration file new server address settings
Disable and stop the ntp server