私はこのようなものを持っています:
$daysDiff = intval($currentDate->diff($dueDate)->format('%R%a'));
DateInterval::format のphpドキュメントには次のように書かれています:
%R -- "+" for positive interval, "-" for negative
%a -- the total count of days i the interval
結果に問題があり、常に6015を日として返し、正しい符号+または-を返します。$currentdate
との日付を変えてみました$dueDate
。この振る舞いの理由を教えてください。
ありがとう