Finding current quarter of year in PowerShell to append in a filename with format “yyyyqq”

后端 未结 4 1798
时光说笑
时光说笑 2020-12-22 02:44

I am trying to find current quarter of year in PowerShell to append in a filename with format yyyyqq.

I have already got current month and week as below

4条回答
  •  伪装坚强ぢ
    2020-12-22 03:37

    Another way:

    $today = Get-Date
    $YearYYYYQQ = "{0}{1:d2}" -f ($today.Year, [int][math]::Ceiling($today.Month/3))
    

提交回复
热议问题