Module for editing date/time settings on macOS
New in version 2016.3.0.
Displays the current date
the system date
CLI Example:
salt '*' timezone.get_date
Get current hardware clock setting (UTC or localtime)
CLI Example:
salt '*' timezone.get_hwclock
Displays the current time zone offset
The current time zone offset
CLI Example:
salt '*' timezone.get_offset
Get the current system time.
The current time in 24 hour format
CLI Example:
salt '*' timezone.get_time
Display the currently set network time server.
the network time server
CLI Example:
salt '*' timezone.get_time_server
Display whether network time is on or off
True if network time is on, False if off
CLI Example:
salt '*' timezone.get_using_network_time
Displays the current time zone
The current time zone
CLI Example:
salt '*' timezone.get_zone
Displays the current time zone abbreviated code
The current time zone code
CLI Example:
salt '*' timezone.get_zonecode
Displays a list of available time zones. Use this list when setting a
time zone using timezone.set_zone
a list of time zones
CLI Example:
salt '*' timezone.list_zones
Set the current month, day, and year
date (str) --
The date to set. Valid date formats are:
%m:%d:%y
%m:%d:%Y
%m/%d/%y
%m/%d/%Y
True if successful, False if not
SaltInvocationError on Invalid Date format
CommandExecutionError on failure
CLI Example:
salt '*' timezone.set_date 1/13/2016
Sets the hardware clock to be either UTC or localtime
CLI Example:
salt '*' timezone.set_hwclock UTC
Sets the current time. Must be in 24 hour format.
time (str) -- The time to set in 24 hour format. The value must be double quoted. ie: '"17:46"'
True if successful, False if not
SaltInvocationError on Invalid Time format
CommandExecutionError on failure
CLI Example:
salt '*' timezone.set_time '"17:34"'
Designates a network time server. Enter the IP address or DNS name for the network time server.
time_server -- IP or DNS name of the network time server. If nothing is passed the time server will be set to the macOS default of 'time.apple.com'
True if successful, False if not
CommandExecutionError on failure
CLI Example:
salt '*' timezone.set_time_server time.acme.com
Set whether network time is on or off.
enable -- True to enable, False to disable. Can also use 'on' or 'off'
str bool
True if successful, False if not
CommandExecutionError on failure
CLI Example:
salt '*' timezone.set_using_network_time True
Set the local time zone. Use timezone.list_zones
to list valid time_zone
arguments
time_zone (str) -- The time zone to apply
True if successful, False if not
SaltInvocationError on Invalid Timezone
CommandExecutionError on failure
CLI Example:
salt '*' timezone.set_zone America/Denver