> ## 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.

# Format date value

> Converts a date value to another format based on the given criteria.

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>;
};

Converts a date value to another format based on the given criteria. Use this when a date arrives in one shape but needs to look different downstream, for example turning an ISO timestamp like `2026-03-09T14:30:00Z` into `09-03-2026`. You can also shift the date between timezones along the way, so a value stored in UTC can be written out in local time. If a value cannot be read as a date, the run fails with an error, so it is worth confirming the formats match your data.

This documentation describes: [Schema](/schemas/mapper/format-date)

## Fields

<FormField property="toFormat" label="Output format" required>
  The layout the date is written out in, built from the standard date format codes, for example `d-m-Y` for `09-03-2026`, `Y-m-d` for `2026-03-09`, or `Y-m-d H:i` to include the time. This is the only required field.
</FormField>

<FormField property="fromFormat" label="Input format">
  The layout the incoming value is already in. Leave it empty to let Alumio recognise common layouts automatically, which works for shapes such as ISO timestamps. Set it only when the input uses an unusual layout that needs spelling out, such as `Ymd` for `20260309`, using the same format codes as the output.
</FormField>

<FormField property="toTimezone" label="Output timezone">
  The timezone the date is converted to before it is written out, for example `Europe/Amsterdam` or `UTC`. Leave it empty to keep the input timezone.
</FormField>

<FormField property="fromTimezone" label="Input timezone">
  The timezone the incoming value should be read as when it does not state one itself. Leave it empty to use the system default.
</FormField>

## Sample data

| Field           | Value              |
| --------------- | ------------------ |
| Output format   | `d-m-Y`            |
| Output timezone | `Europe/Amsterdam` |

Input:

```json theme={null}
{ "orderDate": "2026-03-09T14:30:00Z" }
```

Output:

```json theme={null}
{ "orderDate": "09-03-2026" }
```

```json Configuration theme={null}
{
  "prototype": "format-date",
  "parameters": {
    "toFormat": "d-m-Y",
    "toTimezone": "Europe/Amsterdam"
  }
}
```
