Content deleted Content added
Line 65:
| publisher=Hewlett Packard | access-date=May 1, 2025}}</ref>
===Windows PowerShell===
The '''get-date''' cmdlet provides capabilities similar to the Unix date command. The command's '''-date''' switch{{efn| "In MS-Windows/Powershell a "-switch" is the equivalent of a Unix command option}} can be used to create a date object representing any date and time. Relative time expressions as found in Unix are not part of the specification but the date can be calculated using either ''TimeSpans'' or by switches that set individual fields.
The '''-Uformat''' switch uses Unix % format codes to generate output. An alternate switch '''-Format''' uses .NET custom format strings<ref>{{cite web|author=<!-- not stated --> |title=Custom date and time format strings|date=December 3, 2022|access-date=May 3, 2025|publisher=Microsoft|url=https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings}}</ref> such as dddd (weekday name), MM (month number) and HH:mm for military times.<ref>{{cite web| author=<!-- not stated --> |title=Get-Date|year=2025| access-date=May 3, 2025 | publisher=Microsoft | website=learn.microsoft.com | url=https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/get-date}}</ref>
The '''set-date''' command, like Unix's '''date -s''' command requires administrative privilege to run. The '''-date''' switch requires a date entered in a format compatible with the current locale. One can also compute a date by generating an offset from another date object or use the '''-Adjust''' switch to add or subtract a time interval. <ref>{{cite web| author=<!-- not stated --> |title=Get-Date|year=2025| access-date=May 3, 2025 | publisher=Microsoft | website=learn.microsoft.com | url= https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/set-date}}</ref>
{{Expand section|date=May 2025|further OS/shell examples}}▼
▲{{Expand section|date=May 2025|further OS/shell examples}}
==History==
|