From c293f7208a6b069656c0414fa133f274ed54dc29 Mon Sep 17 00:00:00 2001 From: Dag Wieers 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) --- windows/setup.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/windows/setup.ps1 b/windows/setup.ps1 index 8ee6ccea7ed..ef881b6516d 100644 --- a/windows/setup.ps1 +++ b/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")