<!-- Source: https://docs.squirro.com/en/latest/technical/data-loading/date-format.html -->
# Date Format

Both for formatting as well as parsing dates, date formats are specified using a date format string.

These consist of various tokens that indicate where a certain part of the date is to be placed or expected.

## Dataloaders Facets.json

For the `input_format_string` used in the `facets.json` file for Dataloaders, the python date format is used.

Note: This also applies to the `Time format` option exposed as part of the `Map to labels`` step when adding Data Sources from the UI (e.g. for Excel, CSV, and so on).

Reference: See [http://strftime.org/](http://strftime.org/) for reference information regarding the supported directives.

## Common Format Strings

The following table lists common format strings which are often used in data integration projects:

| Example | Format String | Description |
| --- | --- | --- |
| `2013-06-21T12:22:06.376144` | `YYYY-MM-DDTHH:mm:ss.SSS` | [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format with date and time including microseconds |
| `2013-06-21T12:22:06` | `YYYY-MM-DDTHH:mm:ss` | [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format with date and time |
| `2013-06-21` | `YYYY-MM-DD` | [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format with date only |

## Reference

The following table lists all supported directives which can be used in format strings.

The example column is based on the sample string `2013-06-24T15:21:56.087821`:

| Directive | Meaning | Example |
| --- | --- | --- |
| `MM` | Month as a decimal number [01,12]. | `06` |
| `MMM` | Locale’s abbreviated month name. | `Jun` |
| `MMMM` | Locale’s full month name. | `June` |
| `DD` | Day of the month as a decimal number [01,31]. | `24` |
| `DDDD` | Day of the year as a decimal number [001,366]. | `175` |
| `d` | Weekday as a decimal number [0(Sunday),6]. | `1` |
| `ddd` | Locale’s abbreviated weekday name. | `Mon` |
| `dddd` | Locale’s full weekday name. | `Monday` |
| `YY` | Year without century as a decimal number [00,99]. | `13` |
| `YYYY` | Year with century as a decimal number. | `2013` |
| `A` | Locale’s equivalent of either AM or PM. | `PM` |
| `HH` | Hour (24-hour clock) as a decimal number [00,23]. | `15` |
| `hh` | Hour (12-hour clock) as a decimal number [01,12]. | `03` |
| `mm` | Minute as a decimal number [00,59]. | `21` |
| `ss` | Second as a decimal number [00,61]. | `56` |
| `SSS` | Microsecond as a decimal number [0,999999], zero-padded on the left. | `087821` |
| `%%` | A literal ‘%’ character. | `%%` |
