diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-Date.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-Date.md index d49ea4ac30d..b83b1193933 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-Date.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-Date.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 04/30/2025 +ms.date: 06/30/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/get-date?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Date @@ -556,13 +556,17 @@ The valid **UFormat specifiers** are displayed in the following table: | `%Z` | Time zone offset from Universal Time Coordinate (UTC) | -07 | > [!NOTE] -> Windows PowerShell's behavior with `Get-Date -UFormat %s` is incorrect in two respects: +> In Windows PowerShell, not all **UFormat** specifiers produce the same results as their Unix +> equivalents. For example: > -> - The return value is based on local time instead of UTC time. -> - The string representation of the seconds value has a fractional part. The output is -> culture-sensitive with respect to the decimal mark. +> - `Get-Date -UFormat %s` is incorrect in two respects: +> - The return value is based on local time instead of UTC time. +> - The string representation of the seconds value has a fractional part. The output is +> culture-sensitive with respect to the decimal mark. +> - The formats of `%c`, `%l`, `%k`, `%s`, `%j`, and `%V` aren't consistent with the ISO 8601 +> standard. > -> These behaviors have been fixed in PowerShell 6 and higher. +> These behaviors are fixed in PowerShell 6.1 and higher. ## RELATED LINKS diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Get-Date.md b/reference/7.4/Microsoft.PowerShell.Utility/Get-Date.md index 8e57d208d5d..97c1e204b85 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Get-Date.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Get-Date.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 04/30/2025 +ms.date: 06/30/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/get-date?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Date @@ -657,10 +657,13 @@ The valid **UFormat specifiers** are displayed in the following table: | `%Z` | Time zone offset from Universal Time Coordinate (UTC) | -07 | > [!NOTE] -> The behavior of `-UFormat %s` was changed to fix problems with the behavior in Windows PowerShell. +> Not all **UFormat** specifiers produce the same results as their Unix equivalents. For example: > -> - The return value is based on UTC time. -> - The value is a whole number of seconds value (no fractional part). +> - In Unix-based systems, `%W` returns the week number of the year as a decimal number in the range +> 00 to 53, starting with the first Monday as the first day of week 01. All days before the first +> Monday of the year are in week 00. +> - In PowerShell, `%W` returns the week number of the year as a decimal number, range 1 to 53, with +> no leading zero and no week zero. The first week starts on the first day of the year. ## RELATED LINKS diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Get-Date.md b/reference/7.5/Microsoft.PowerShell.Utility/Get-Date.md index 06232e579b9..ea06fb15682 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Get-Date.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Get-Date.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 04/30/2025 +ms.date: 06/30/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/get-date?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Date @@ -657,10 +657,13 @@ The valid **UFormat specifiers** are displayed in the following table: | `%Z` | Time zone offset from Universal Time Coordinate (UTC) | -07 | > [!NOTE] -> The behavior of `-UFormat %s` was changed to fix problems with the behavior in Windows PowerShell. +> Not all **UFormat** specifiers produce the same results as their Unix equivalents. For example: > -> - The return value is based on UTC time. -> - The value is a whole number of seconds value (no fractional part). +> - In Unix-based systems, `%W` returns the week number of the year as a decimal number in the range +> 00 to 53, starting with the first Monday as the first day of week 01. All days before the first +> Monday of the year are in week 00. +> - In PowerShell, `%W` returns the week number of the year as a decimal number, range 1 to 53, with +> no leading zero and no week zero. The first week starts on the first day of the year. ## RELATED LINKS diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Get-Date.md b/reference/7.6/Microsoft.PowerShell.Utility/Get-Date.md index 26c8f59d011..dab606d27aa 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Get-Date.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Get-Date.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 03/19/2024 +ms.date: 06/30/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/get-date?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Date @@ -657,10 +657,13 @@ The valid **UFormat specifiers** are displayed in the following table: | `%Z` | Time zone offset from Universal Time Coordinate (UTC) | -07 | > [!NOTE] -> The behavior of `-UFormat %s` was changed to fix problems with the behavior in Windows PowerShell. +> Not all **UFormat** specifiers produce the same results as their Unix equivalents. For example: > -> - The return value is based on UTC time. -> - The value is a whole number of seconds value (no fractional part). +> - In Unix-based systems, `%W` returns the week number of the year as a decimal number in the range +> 00 to 53, starting with the first Monday as the first day of week 01. All days before the first +> Monday of the year are in week 00. +> - In PowerShell, `%W` returns the week number of the year as a decimal number, range 1 to 53, with +> no leading zero and no week zero. The first week starts on the first day of the year. ## RELATED LINKS diff --git a/reference/7.7/Microsoft.PowerShell.Utility/Get-Date.md b/reference/7.7/Microsoft.PowerShell.Utility/Get-Date.md index 93ea7528b34..bc918f74bbf 100644 --- a/reference/7.7/Microsoft.PowerShell.Utility/Get-Date.md +++ b/reference/7.7/Microsoft.PowerShell.Utility/Get-Date.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 03/19/2024 +ms.date: 06/30/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/get-date?view=powershell-7.7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Date @@ -657,10 +657,13 @@ The valid **UFormat specifiers** are displayed in the following table: | `%Z` | Time zone offset from Universal Time Coordinate (UTC) | -07 | > [!NOTE] -> The behavior of `-UFormat %s` was changed to fix problems with the behavior in Windows PowerShell. +> Not all **UFormat** specifiers produce the same results as their Unix equivalents. For example: > -> - The return value is based on UTC time. -> - The value is a whole number of seconds value (no fractional part). +> - In Unix-based systems, `%W` returns the week number of the year as a decimal number in the range +> 00 to 53, starting with the first Monday as the first day of week 01. All days before the first +> Monday of the year are in week 00. +> - In PowerShell, `%W` returns the week number of the year as a decimal number, range 1 to 53, with +> no leading zero and no week zero. The first week starts on the first day of the year. ## RELATED LINKS