---
name: "Catmandu::Fix::expand_date"
section: "3pm"
platform: "linux"
package: "libcatmandu-perl"
version: "1.2024-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Catmandu::Fix::expand_date"
---

# Catmandu::Fix::expand\_date(3pm)

expand a date field into year, month and date

## NAME

Catmandu::Fix::expand\_date - expand a date field into year, month and date

## NOTE

This package is DEPRECATED and will be removed in the future. Please use Catmandu::Fix::split\_date.

Reasons:

- •

  it writes directly in the root of the hash, which is a different behaviour compared to all the other fixes (sum, count, hash, array ..)

- •

  it adds the new keys in a different location, instead of "in place".

- •

  its behaviour cannot be changed without breaking its current use

## SYNOPSIS

```
    # {date => "2001-09-11"}
    expand_date()
    # => {year => 2001, month => "9", day => "11", date => "2001-09-11"}
    # {datestamp => "2001:09"}
    expand_date(datestamp)
    # => {year => 2001, month => "9", datestamp => "2001:09"}
```

## DESCRIPTION

The date field is expanded if it contains a year, optionally followed by numeric month and day, each separated by `"-"` or `":"`.
