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.
Pythonを使用して前の月と年を取得するにはどうすればよいですか? datetime モジュールを使用して取得することは可能ですか
次の例のように取得したい
current: 2012-03 prev 2012-02 current: 2012-01 prev 2011-12
使用する
date(2012,3,1)+relativedelta(years=-1)
http://labix.org/python-dateutilを参照してください