File size: 419 Bytes
1a92f7e
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
from datetime import datetime, timedelta
import calendar


def get_current_month_range():
    """Helper function to get the first and last dates of the current month."""
    now = datetime.now()
    start_of_month = datetime(now.year, now.month, 1)
    _, last_day = calendar.monthrange(now.year, now.month)
    end_of_month = datetime(now.year, now.month, last_day, 23, 59, 59)
    return start_of_month, end_of_month