mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Add '%F' case to Get-Date -UFormat (#7630)
This commit is contained in:
committed by
Ilya
parent
98cf44cdec
commit
39252b4938
@@ -372,6 +372,10 @@ namespace Microsoft.PowerShell.Commands
|
||||
sb.Append(StringUtil.Format("{0,2}", dateTime.Day));
|
||||
break;
|
||||
|
||||
case 'F':
|
||||
sb.Append("{0:yyyy}-{0:MM}-{0:dd}");
|
||||
break;
|
||||
|
||||
case 'G':
|
||||
sb.Append("{0:yyyy}");
|
||||
break;
|
||||
|
||||
@@ -208,7 +208,7 @@ Describe "Get-Date -UFormat tests" -Tags "CI" {
|
||||
@{ date = $date1; format = "%D"; result = "04/05/30" } # date; same as %m/%d/%y
|
||||
@{ date = $date1; format = "%e"; result = " 5" } # day of month, space padded; same as %_d
|
||||
@{ date = $date2; format = "%e"; result = "15" }
|
||||
#@{ date = $date1; format = "%F"; result = "" }
|
||||
@{ date = $date1; format = "%F"; result = "2030-04-05" }# Equivalent to %Y-%m-%d (the ISO 8601 date format).
|
||||
#@{ date = $date1; format = "%g"; result = "" } # last two digits of year of ISO week number (see %G)
|
||||
# TODO: need review. Broken C# implementation.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user