
from datetime import datetime, timedelta

DT_FORMAT = '%Y-%m-%d %H:%M:%S%z'


def datetime_html_format(date):
    return date.strftime("%Y-%m-%dT%H:%M")


def datetime_to_string(datetime):
    return datetime.strftime(datetime, DT_FORMAT)


def string_to_datetime(date):
    return datetime.strptime(date, DT_FORMAT)


def date_range(start_date, end_date):
    return list(start_date + timedelta(x) for x in range((end_date - start_date).days + 1))


from datetime import datetime, timedelta

DT_FORMAT = '%Y-%m-%d %H:%M:%S%z'


def datetime_html_format(date):
    return date.strftime("%Y-%m-%dT%H:%M")


def datetime_to_string(date):
    return date.strftime(DT_FORMAT)


def string_to_datetime(date):
    return datetime.strptime(date, DT_FORMAT)


def date_range(start_date, end_date):
    return list(start_date + timedelta(x) for x in range((end_date - start_date).days + 1))

Fix error on date save
Fix error on date save

  
  from datetime import datetime, timedelta
  
  DT_FORMAT = '%Y-%m-%d %H:%M:%S%z'
  
  
  def datetime_html_format(date):
      return date.strftime("%Y-%m-%dT%H:%M")
  
  
- def datetime_to_string(datetime):
+ def datetime_to_string(date):
-     return datetime.strftime(datetime, DT_FORMAT)
+     return date.strftime(DT_FORMAT)
  
  
  def string_to_datetime(date):
      return datetime.strptime(date, DT_FORMAT)
  
  
  def date_range(start_date, end_date):
      return list(start_date + timedelta(x) for x in range((end_date - start_date).days + 1))
  
Fix error on date save
## Code Before:

from datetime import datetime, timedelta

DT_FORMAT = '%Y-%m-%d %H:%M:%S%z'


def datetime_html_format(date):
    return date.strftime("%Y-%m-%dT%H:%M")


def datetime_to_string(datetime):
    return datetime.strftime(datetime, DT_FORMAT)


def string_to_datetime(date):
    return datetime.strptime(date, DT_FORMAT)


def date_range(start_date, end_date):
    return list(start_date + timedelta(x) for x in range((end_date - start_date).days + 1))

## Instruction:
Fix error on date save
## Code After:

from datetime import datetime, timedelta

DT_FORMAT = '%Y-%m-%d %H:%M:%S%z'


def datetime_html_format(date):
    return date.strftime("%Y-%m-%dT%H:%M")


def datetime_to_string(date):
    return date.strftime(DT_FORMAT)


def string_to_datetime(date):
    return datetime.strptime(date, DT_FORMAT)


def date_range(start_date, end_date):
    return list(start_date + timedelta(x) for x in range((end_date - start_date).days + 1))
