フィルターのクリア

date of a file, but not time

1 回表示 (過去 30 日間)
Damian
Damian 2014 年 7 月 21 日
コメント済み: Star Strider 2014 年 7 月 21 日
Hi,
Im getting date and time of creation of a file with : A = dir(myfile); disp(A.date)
and I end up with
07-lip-2014 03:35:30
while all I want is :
07-07-07.
So no time and month name, 'lipiec' or 'July' as 07 - how do I do that ??
Kind regards Damian

採用された回答

Star Strider
Star Strider 2014 年 7 月 21 日
Use the .datenum option:
ds = datestr(A.datenum, 'dd-mm-yy');
So if the date of ‘A’ is today (21-lip-2014), it would return 21-07-14. See the documentation for datestr for other options.

その他の回答 (1 件)

Damian
Damian 2014 年 7 月 21 日
thank you so much !
  1 件のコメント
Star Strider
Star Strider 2014 年 7 月 21 日
My pleasure!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by