掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
ディレクトリの日付について (ID:25196)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
どうもありがどうございました。Windows.FindFirstFileという関数についてはまったく知りませんでした。 ついでで恐縮ですが、各日付をTDateTimeに変換するには、次のように TFileTime⇒TSystemTime⇒TDateTimeのような2段かでの変換しか方法はないのでしょうか。 例 procedure TForm1.Button1Click(Sender: TObject); var Handle: THandle; Data: TWin32FindData; ft: TFileTime; st: TSystemTime; dt: TDateTime; begin Handle := Windows.FindFirstFile('C:\Temp\新しいフォルダ', Data); if Handle = INVALID_HANDLE_VALUE then Label1.Caption := '見つかりません' else begin FileTimeToLocalFileTime(Data.ftLastWriteTime, ft); FileTimeToSystemTime(ft, st); dt := SystemTimeToDateTime(st); Label1.Caption := FormatDateTime('YYYY.mm.dd hh:mm:ss', dt); FileTimeToLocalFileTime(Data.ftLastAccessTime, ft); FileTimeToSystemTime(ft, st); dt := SystemTimeToDateTime(st); Label2.Caption := FormatDateTime('YYYY.mm.dd hh:mm:ss', dt); FileTimeToLocalFileTime(Data.ftCreationTime, ft); FileTimeToSystemTime(ft, st); dt := SystemTimeToDateTime(st); Label3.Caption := FormatDateTime('YYYY.mm.dd hh:mm:ss', dt); end; end;
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.