- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
Powershell Get-Date说明:
-Day
Specifies the day of the month that is displayed. Enter a value from 1 to 31. >The default is the current day.
If you specify a value that is greater than the number of days in the month, >PowerShell adds the number of days to the month and displays the result. For >example, "Get-Date -Month 2 -Day 31" displays "March 3", not "February 31".
January 1
,这是否还会延续到新年,还是我必须调整代码以检测新年?
最佳答案
不,它不会过期,因为12月有31天,任何高于31天的情况都是异常(exception)。
Get-Date -Month 2 -Day 32
Get-Date : Cannot validate argument on parameter 'Day'. The 32 argument is greater than the maximum allowed range of 31. Supply an argument that is less than or equal to 31 and then try the command again.
At line:1 char:24
+ get-date -month 2 -day 32
+
+ CategoryInfo : InvalidData: (:) [Get-Date], ParameterBindingValidationException
+ FullyQualifiedErrorId :
ParameterArgumentValidationError,Microsoft.PowerShell.Commands.GetDateCommand
Get-Date -Month 12 -Day 32
Get-Date : Cannot validate argument on parameter 'Day'. The 32 argument is greater than the maximum allowed range of 31. Supply an argument that is less than or equal to 31 and then try the command again.
At line:1 char:24
+ get-date -month 2 -day 32
+
+ CategoryInfo : InvalidData: (:) [Get-Date], ParameterBindingValidationException
+ FullyQualifiedErrorId :
ParameterArgumentValidationError,Microsoft.PowerShell.Commands.GetDateCommand
关于.net - Powershell Get-Date -Day(新年),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53806430/
我是一名新手程序员,正在尝试制作日历(作业的一部分)。我已经完成了其他所有内容,但陷入了寻找新年索引(从 0 - 6)的部分,该索引每年向右移动一位,除了闰年之后的那一年移动两位。对于这个特定部分,我
Powershell Get-Date说明: -Day Specifies the day of the month that is displayed. Enter a value from 1 t
我是一名优秀的程序员,十分优秀!