Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
文字列として表された一連の日付があり、これらを日付型に変換するのは簡単ですが、前日の日付を必要とする計算を実行する必要があります。たとえば、日付が 13-09-2013 の場合、日付 12-09-2013 を導出する必要があります。これを達成するためのきれいな方法はありますか?理想的にはブーストを使用します。
よろしくお願いします
using namespace boost::gregorian; date d(2013,Sep,13); d -= days(1);
デモ
現在の日付を取得し、1 日を減算すると、昨日になります。