From efaaa791576c7b29a15c45e1e34c2dc1a91024d3 Mon Sep 17 00:00:00 2001
From: Dag Wieers <dag@wieers.com>
Date: Thu, 9 Jun 2016 00:36:48 +0200
Subject: [PATCH] Ensure we are using an English locale for date formatting.
 (as hinted by @nitzmahone)

---
 lib/ansible/modules/windows/setup.ps1 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/ansible/modules/windows/setup.ps1 b/lib/ansible/modules/windows/setup.ps1
index 11dfba1cad..49d37453d6 100644
--- a/lib/ansible/modules/windows/setup.ps1
+++ b/lib/ansible/modules/windows/setup.ps1
@@ -128,7 +128,7 @@ Set-Attr $result.ansible_facts "ansible_user_uid" ([int] $user.User.Value.Substr
 Set-Attr $result.ansible_facts "ansible_user_sid" $user.User.Value
 
 # Use English locale
-[System.Threading.Thread]::CurrentThread.CurrentCulture = [System.Globalization.CultureInfo]::GetCultureInfo('en-US')
+$culture = New-Object System.Globalization.CultureInfo('en-US')
 $date = New-Object psobject
 $datetime = (Get-Date)
 $datetime_utc = $datetime.ToUniversalTime()
@@ -146,7 +146,7 @@ Set-Attr $date "second" $datetime.ToString("ss")
 Set-Attr $date "time" $datetime.ToString("HH:mm:ss")
 Set-Attr $date "tz_offset" $datetime.ToString("zzzz")
 Set-Attr $date "tz" ([System.TimeZoneInfo]::Local.Id)
-Set-Attr $date "weekday" $datetime.ToString("dddd")
+Set-Attr $date "weekday" $datetime.ToString("dddd", $culture)
 Set-Attr $date "weekday_number" (Get-Date -UFormat "%w")
 Set-Attr $date "weeknumber" (Get-Date -UFormat "%W")
 Set-Attr $date "year" $datetime.ToString("yyyy")