> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alumio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Is valid date/time

> Checks if the value is a valid date/time.

export const FormField = ({property, label, required = false, diType, uiPatterns, children}) => {
  const patterns = Array.isArray(uiPatterns) ? uiPatterns : uiPatterns ? [uiPatterns] : [];
  return <div style={{
    margin: '1.5rem 0'
  }}>
      <div style={{
    display: 'flex',
    alignItems: 'baseline',
    flexWrap: 'wrap',
    gap: '0.5rem',
    marginBottom: '0.25rem'
  }}>
        <strong>{label}</strong>
        <span style={{
    fontSize: '0.7rem',
    fontWeight: 600,
    textTransform: 'uppercase',
    letterSpacing: '0.04em',
    color: required ? '#6241f5' : '#6b7280'
  }}>
          {required ? 'Required' : 'Optional'}
        </span>
      </div>

      <div>{children}</div>

      {diType || patterns.length > 0 ? <p style={{
    fontSize: '0.85rem',
    color: '#6b7280',
    marginBottom: 0
  }}>
          {diType ? <>
              See the <a href={`/references/${diType}`}>{diType}</a> reference.{' '}
            </> : null}
          {patterns.length > 0 ? <>
              Accepts a <a href={`/documentation/placeholders-and-patterns/patterns#${patterns[0]}`}>pattern</a>.
            </> : null}
        </p> : null}
    </div>;
};

Checks whether the incoming value is a valid date or time. Use this to confirm a date field holds a real, well-formed date before you rely on it, or to separate records with a usable date from ones you need to clean up or reject. When you set a Format, the value not only has to be a real date but also has to be written exactly in that layout, so `2026-06-19` passes the format `Y-m-d` while `19/06/2026` does not. Leave the Format empty to accept any date or time the system can recognise.

This documentation describes: [Schema](/schemas/condition/format-datetime)

## Fields

<FormField property="format" label="Format">
  The exact layout the date has to be written in, using the standard date letters: `Y` for a four-digit year, `m` for a two-digit month, `d` for a two-digit day, `H` for hours, `i` for minutes, and `s` for seconds. For example `Y-m-d` matches `2026-06-19` and `d/m/Y H:i` matches `19/06/2026 14:30`. When set, the value must both be a real date and match this layout precisely. Leave it empty to accept any recognisable date or time.
</FormField>

## Sample data

The condition was run with the Format below against a date field.

| Field  | Value   |
| ------ | ------- |
| Format | `Y-m-d` |

| Incoming value | Result         |
| -------------- | -------------- |
| `2026-06-19`   | Matches        |
| `19/06/2026`   | Does not match |

With the Format left empty, both values above would match, because each can still be read as a date.

```json Configuration theme={null}
{
  "prototype": "format-datetime",
  "parameters": {
    "format": "Y-m-d"
  }
}
```
