Setup default date format like yyyy-mm-dd in Powershell?

后端 未结 3 1689
借酒劲吻你
借酒劲吻你 2020-12-16 01:44

A simple & short question:

How can I setup a default date format in powershell like yyyy-mm-dd ? so any date output will be like this format?

3条回答
  •  借酒劲吻你
    2020-12-16 02:40

    for always usage you can add in your .\Documents\WindowsPowerShell\profile.ps1

    $culture = (Get-Culture).Clone()
    $culture.DateTimeFormat.ShortDatePattern = 'yyyy-MM-dd'
    Set-Culture $culture
    

提交回复
热议问题