# checkdate: Check Date against Condition

> checkdate (Check Date against Condition) is a 1001fx API function in the group Date & time: POST https://api.1001fx.com/datetime/checkdate, 1 credit per call. It works as a ready-made module in Make and n8n or as a plain HTTP call.

Checks a date against different conditions.

- Group: Date & time
- Endpoint: `POST https://api.1001fx.com/datetime/checkdate`
- Authentication: header `X-API-KEY: YOURSECRETAPIKEY`
- Content type: application/json
- Credits: 1 credit per call
- Ready-made in: Make and n8n
- Docs: https://1001fx.com/functions/checkdate

## Parameters

- `date` (string (DD.MM.YYYY), required) – Date: The date to check. Your date needs to be in one of the following formats DD.MM.YYYY, DD.MM.YY, DD.MM.YYYY HH:mm, DD.MM.YY HH:mm, MM-DD-YYYY, MM-DD-YYYY HH:mm, MM-DD-YY, MM-DD-YY HH:mm.
- `condition` (enum, required, one of `isDate`, `isWeekday`, `isWeekend`, `isLeapYear`, `isUTC`) – Condition: Condition to check the date against

## Use cases

- Skip a workflow run on weekends
- Check that a date from a form is valid before you write it to a CRM
- Branch a workflow depending on whether a date is a weekday

## Example: Check if date is valid

```bash
curl -X POST 'https://api.1001fx.com/datetime/checkdate' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"date":"14.08.2020","condition":"isDate"}'
```

Answer (HTTP 200):

```json
{
  "result": true
}
```

## FAQ

**Which conditions can I check?**

isDate (a valid date), isWeekday, isWeekend, isLeapYear and isUTC. The answer is true or false.

**Which date formats are accepted?**

DD.MM.YYYY, DD.MM.YY and MM-DD-YYYY, MM-DD-YY, each with or without a time in HH:mm.

**Does isWeekday take public holidays into account?**

No, it only checks the day of the week. Use isholiday to check public holidays of a country or state.
