This endpoint calculates the number of days between two given dates. The user must provide the dates in a specified format, and it will return the difference in days.
Endpoint Information
- Method: POST
- Endpoint URL:
https://node.nodetrigger.com/api/date-difference
- Content Type:
application/json
Example Requests
Here is an example of how to make a request to this endpoint:
POST https://node.nodetrigger.com/api/date-difference
Content-Type: application/json
{
"date1": "01/01/2023",
"date2": "01/10/2023",
"format": "MM/DD/YYYY"
}
The endpoint will respond with the number of days between the two dates:
{
"days_difference": 9
}
Notes
- The
date1
anddate2
fields should be strings representing valid dates. - The
format
field should either beMM/DD/YYYY
orDD/MM/YYYY
, depending on the format of the input dates. - If the dates or format are invalid, the endpoint will return an error message.
- The date difference is measured in full days, without considering hours or minutes.
“`