ISO8601 Weeknumber SOLVED! #47898
Replies: 5 comments 17 replies
-
Per ISO08061 standard, it uses The correct script in Powershell should be: [System.Globalization.CultureInfo]::InvariantCulture.Calendar.GetWeekOfYear((Get-Date($DT)), 'FirstFourDayWeek', 'Monday') |
Beta Was this translation helpful? Give feedback.
-
... soooooo, what values are you getting, and what do you believe the correct values should be? "It's not working" is not a diagnosable, reproducible, problem (or at least, not reliably and easily). Especially in any area where culture settings are involved. Note that I'm otherwise with @huoyaoyuan here - you probably need the invariant culture. |
Beta Was this translation helpful? Give feedback.
-
@Clockwork-Muse Still a bug... And Culture or UICulture or InvariantCulture all the same bug. |
Beta Was this translation helpful? Give feedback.
-
Okay, so, apparently you can't map exactly to ISO8601 via |
Beta Was this translation helpful? Give feedback.
-
So I made a funtion:
Following the ISO standard the First day of the week has Number 1 so on to Number 7
Will output:
And today:
Gave:
|
Beta Was this translation helpful? Give feedback.
-
I have found a problem with getting the correct weeknumber via:
OR
This does NOT give all the right answers.
I have tried to bugfix the problem and came up with solutions for Culture and UICulture:
But it would better if the first function would work correct.
Both give the correct results when using:
Will give:
Beta Was this translation helpful? Give feedback.
All reactions