現在時刻を使ったフォ​ルダを作るにはどうす​ればいいですか?

24 visualizaciones (últimos 30 días)
MathWorks Support Team
MathWorks Support Team el 10 de Sept. de 2019
Respondida: MathWorks Support Team el 10 de Sept. de 2019
現在時刻を使ったフォルダ名で新規フォルダを作成する方法を教えてください。

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 10 de Sept. de 2019
datetime 関数を使って現在の日時を取得し、char 関数でテキストに変換します。
datetime 関数の Format プロパティにて出力テキストのフォーマットを指定します。
% フォルダ名の作成
>> fname = char(datetime('now','Format','yyyyMMdd'))
fname =
'20190910'
>> mkdir(fname) % フォルダの作成

Más respuestas (0)

Categorías

Más información sobre 日付と時刻 en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Productos


Versión

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!