Skip to content
Browse all functions

Check Date against Condition

datetime/checkdate

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.

1 credit per callHTTP APIn8nMake

Checks a date against different conditions.

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

Try it in the 1001fx app

Run checkdate in your browser with your API key – fill the form, click Run and get the answer or the file.

checkdate in the 1001fx app: the form with example values
Check Date against Condition in the 1001fx app

Endpoint

POSThttps://api.1001fx.com/datetime/checkdate
Header
X-API-KEY: YOURSECRETAPIKEY How to
Content type
application/json

Parameters

  • datestring (DD.MM.YYYY)required

    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.

    Example:
    14.08.2020
  • conditionenumrequired

    Condition to check the date against

    Values:
    isDate
    isWeekday
    isWeekend
    isLeapYear
    isUTC
    Example:
    isDate

Examples

Check if date is valid

Checks if the given date is valid

Input

Expects a json body
{
  "date": "14.08.2020",
  "condition": "isDate"
}

Output · HTTP 200

Response
{
  "result": true
}
Show curl command
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"}'

Check if date is a weekday

Checks if the given date is a weekday

Input

Expects a json body
{
  "date": "03-20-2022",
  "condition": "isWeekday"
}

Output · HTTP 200

Response
{
  "result": false
}
Show curl command
curl -X POST 'https://api.1001fx.com/datetime/checkdate' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"date":"03-20-2022","condition":"isWeekday"}'

Check if date is on the weekend

Checks if the given date is on the weekend

Input

Expects a json body
{
  "date": "03-20-2022",
  "condition": "isWeekend"
}

Output · HTTP 200

Response
{
  "result": true
}
Show curl command
curl -X POST 'https://api.1001fx.com/datetime/checkdate' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"date":"03-20-2022","condition":"isWeekend"}'

Check if date is a leap year

Checks if the given date is in a leap year

Input

Expects a json body
{
  "date": "03-20-2022",
  "condition": "isLeapYear"
}

Output · HTTP 200

Response
{
  "result": false
}
Show curl command
curl -X POST 'https://api.1001fx.com/datetime/checkdate' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"date":"03-20-2022","condition":"isLeapYear"}'

Check if date is in UTC (Coordinated Universal Time) format

Checks if the given date is in in UTC format

Input

Expects a json body
{
  "date": "03-20-2022",
  "condition": "isUTC"
}

Output · HTTP 200

Response
{
  "result": false
}
Show curl command
curl -X POST 'https://api.1001fx.com/datetime/checkdate' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"date":"03-20-2022","condition":"isUTC"}'

Frequently asked questions

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.

Use cases

Try checkdate now

Run it in your browser or create a free account and get 100 credits every month.

Changelog

  • 1.0.002.03.2023created
Ask 1001fx