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

后端 未结 4 1802
时光说笑
时光说笑 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条回答
  •  Happy的楠姐
    2020-12-22 03:25

    one way is:

    $yearYYYYQQ = "$(get-date -uformat %Y)$("{0:00}" -f [int]((get-date).month/4) )"
    

提交回复
热议问题