LoginSignup
2
2

More than 5 years have passed since last update.

【コマンドプロンプト】日時文字列をYYYYMMDD_hhmmss形式で取得する

Last updated at Posted at 2018-06-07
>set TIME2=%TIME: =0% & set datetimestr=%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%_%TIME2:~0,2%%TIME2:~3,2%%TIME2:~6,2%

>echo %datetimestr%
20180607_093010

あとは%datetimestr%を煮るなり焼くなり好きにしてくだされ。

参考:Windowsのバッチファイル中で日付をファイル名に使用する (1/2):Tech TIPS - @IT

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2