2つの日付時刻の値を比較し、その差を返します。
Result := DateDiff(DateTime1, DateTime2, TimeUnits)
型:文字列
YYYYMMDDHH24MISS形式の日付・時間スタンプです。
If either is an empty string, the current local date and time (A_Now) is used.
型:文字列
差を測る単位。TimeUnitsは、以下の文字列のいずれか(または最初の文字のみ)を指定します:Seconds, Minutes, Hours または Days.
型:整数
説明: 2つのタイムスタンプの差をTimeUnitsで指定された単位で返す。If DateTime1 is earlier than DateTime2, a negative number is returned.
The result is always rounded down to the nearest integer. 例えば、2つのタイムスタンプの実際の差が1.999日であれば、1日として報告されることになります。If higher precision is needed, specify Seconds for TimeUnits and divide the result by 60.0, 3600.0, or 86400.0.
組込変数A_Nowには、現在のローカルタイムがYYYYMMDDHH24MISS形式で格納されます。
2つのイベント間の経過時間を正確に求めるには、ミリ秒単位の精度を持つA_TickCountメソッドを使用します。
タイムスタンプから秒、分、時間、日数を加算または減算するには、DateAddを使用します(減算は負の数を加算することで実現します)。
DateTimeに無効なタイムスタンプや1601年より前の年が含まれる場合、ValueErrorがスローされます。。
DateAdd, FileGetTime, FormatTime