Created
September 11, 2013 09:05
-
-
Save webus/6521115 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import * | |
import calendar | |
#вычисляем начальную дату (1 день текущего месяца) | |
_date_from = date(datetime.now().year,datetime.now().month,1) | |
#30 дней назад | |
_date_from = datetime.now() + timedelta(-30) | |
#вычисляем конечную дату (последний день текущего месяца) | |
_date_to = date(datetime.now().year,datetime.now().month,calendar.monthrange(datetime.now().year,datetime.now().month)[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment