sasaki-saku commited on
Commit
3871a96
1 Parent(s): d6da80d

Update api_usage.py

Browse files
Files changed (1) hide show
  1. api_usage.py +1 -1
api_usage.py CHANGED
@@ -494,7 +494,7 @@ def check_aws_billing(session):
494
  try:
495
  ce = session.client('ce')
496
  now = datetime.now()
497
- start_date = now.replace(day=1).strftime('%Y-%m-%d')
498
  end_date = (now.replace(day=1, month=now.month % 12 + 1, year=now.year + (now.month // 12)).strftime('%Y-%m-%d'))
499
  ce_cost = ce.get_cost_and_usage(
500
  TimePeriod={ 'Start': start_date, 'End': end_date },
 
494
  try:
495
  ce = session.client('ce')
496
  now = datetime.now()
497
+ start_date = now.replace(day=1, month=now.month % 12 - 1).strftime('%Y-%m-%d')
498
  end_date = (now.replace(day=1, month=now.month % 12 + 1, year=now.year + (now.month // 12)).strftime('%Y-%m-%d'))
499
  ce_cost = ce.get_cost_and_usage(
500
  TimePeriod={ 'Start': start_date, 'End': end_date },