summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-08-18 12:47:14 -0700
committerTim Smith <tsmith84@gmail.com>2020-08-18 12:47:14 -0700
commit6c5972683d5b6535491122f0155d41541b722804 (patch)
treea34cd40864ab8e2e50a9e936bd71eb8f3711dd95
parent71a21fd394864fc80a9679d82f32b4319d038bef (diff)
downloadchef-6c5972683d5b6535491122f0155d41541b722804.tar.gz
Better specify how to set timezones on windows
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/windows.rb2
-rw-r--r--lib/chef/resource/timezone.rb12
2 files changed, 11 insertions, 3 deletions
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb b/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb
index df176e8751..aa53ca6365 100644
--- a/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb
@@ -23,7 +23,7 @@ powershell_script "sensitive sleep" do
sensitive true
end
-timezone "UTC"
+timezone "Pacific Standard time"
include_recipe "ntp"
diff --git a/lib/chef/resource/timezone.rb b/lib/chef/resource/timezone.rb
index 9c9396c250..ff0a99d00d 100644
--- a/lib/chef/resource/timezone.rb
+++ b/lib/chef/resource/timezone.rb
@@ -26,7 +26,7 @@ class Chef
provides :timezone
- description "Use the **timezone** resource to change the system timezone on Windows, Linux, and macOS hosts. Timezones are specified in tz database format, with a complete list of available TZ values for Linux and macOS here: <https://en.wikipedia.org/wiki/List_of_tz_database_time_zones> and for Windows here: <https://ss64.com/nt/timezones.html>."
+ description "Use the **timezone** resource to change the system timezone on Windows, Linux, and macOS hosts. Timezones are specified in tz database format, with a complete list of available TZ values for Linux and macOS here: <https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>. On Windows systems run `tzutil /l` for a complete list of valid timezones."
introduced "14.6"
examples <<~DOC
**Set the timezone to UTC**
@@ -35,13 +35,21 @@ class Chef
timezone 'UTC'
```
- **Set the timezone to UTC with a friendly resource name on Linux/macOS**
+ **Set the timezone to America/Los_Angeles with a friendly resource name on Linux/macOS**
```ruby
timezone 'Set the host's timezone to America/Los_Angeles' do
timezone 'America/Los_Angeles'
end
```
+
+ **Set the timezone to PST with a friendly resource name on Windows**
+
+ ```ruby
+ timezone 'Set the host's timezone to PST' do
+ timezone 'Pacific Standard time'
+ end
+ ```
DOC
property :timezone, String,