- Python 3.11
- FastAPI 0.111.0
This document provides an overview of the API endpoints available in the application. Each endpoint serves a specific function, as detailed below.
- Endpoint:
/generate_current_datetime
- Method:
GET
- Description: Returns the current datetime.
- Response:
current_datetime
: The current datetime in ISO format.
- Endpoint:
/days_between_dates
- Method:
POST
- Description: Calculates the number of days between two dates.
- Request Body:
date1
: The start date in ISO format.date2
: The end date in ISO format.
- Response:
days_between
: The number of days betweendate1
anddate2
.
- Endpoint:
/string_to_datetime
- Method:
POST
- Description: Converts a string representation of a date into a datetime object based on the provided format.
- Request Body:
date_string
: The date string to convert.date_format
: The format of the date string (default is "%Y-%m-%d").
- Response:
result_date
: The converted datetime in ISO format.