Add '%F' case to Get-Date -UFormat (#7630)

This commit is contained in:
Benjamin P. McKenna
2018-10-01 08:39:14 +05:00
committed by Ilya
parent 98cf44cdec
commit 39252b4938
2 changed files with 5 additions and 1 deletions
@@ -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.
#