FileGetTime

ファイルやフォルダの日時のスタンプを取得します。

Timestamp := FileGetTime(Filename, WhichTime)

パラメータ

Filename

型:文字列

省略されたときは、最も内側の file loop 中の現在のファイルが設定されます。Otherwise, specify the name of the target file or folder, which is assumed to be in A_WorkingDir if an absolute path isn't specified.

WhichTime

型:文字列

If blank or omitted, it defaults to M. Otherwise, specify one of the following letters to set which timestamp should be retrieved:

戻り値

型:文字列

この関数は、YYYYMMDDHH24MISS形式の数字列を返します。時刻はUTC/GMTではなく、ご自身の現地時間です。この文字列は数値として扱えません。つまり計算したり、数として比較はできません。

エラー処理

失敗したときはOSErrorをスローします。

A_LastErrorには、オペレーティングシステムのGetLastError()関数の結果が設定されます。

備考

日時の説明については、YYYYMMDDHH24MISSをご覧ください。

FileSetTime, FormatTime, FileGetAttrib, FileSetAttrib, FileGetSize, FileGetVersion, file loop, DateAdd, DateDiff

修正時刻を取得し、Timestampに格納します。

Timestamp := FileGetTime("C:\My Documents\test.doc")

作成時刻を取得し、Timestampに格納します。

Timestamp := FileGetTime("C:\My Documents\test.doc", "C")