Skip to content

Instantly share code, notes, and snippets.

@nkabir
Last active December 27, 2015 04:39
Show Gist options
  • Save nkabir/7268827 to your computer and use it in GitHub Desktop.
Save nkabir/7268827 to your computer and use it in GitHub Desktop.
relative delta
#!/usr/bin/env python
import datetime
from dateutil.relativedelta import relativedelta
beg = datetime.datetime(2010,10,30)
rd = relativedelta(months=2)
end = beg + rd
print beg, end, rd
###### Output
# 2010-10-30 00:00:00 2010-12-30 00:00:00 relativedelta(months=+2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment