PowerShell 現在日時から日付だけを取得する

PowerShell 現在日時から日付だけを取得する

PowerShellで、現在日時から日付だけを取得する手順を掲載してます。

環境

  • OS windows 11 home
  • powershell 5.1.22000.282

現在日時から日付だけを取得

現在日時から日付だけを取得するには、以下のコマンドを実行します。

> Get-Date -DisplayHint Date

2022年3月18日

時刻だけを取得する場合は、以下のコマンドを実行します。

> Get-Date -DisplayHint Time             

14:54:13