IRIS Toolbox Reference Manual

## dat2str

Convert IRIS dates to cell array of strings

#### Syntax

    S = dat2str(Dat,...)

#### Input arguments

- `Dat` [ numeric ] - IRIS serial date number(s).

#### Output arguments

- `S` [ cellstr ] - Cellstr with strings representing the input dates.

#### Options

- `'dateFormat='` [ char | cellstr | 'YYYYFP' ] - Date format string, or array of format strings (possibly different for each date).

- `'freqLetters='` [ char | 'YHQBM' ] - Letters representing the five possible frequencies (annual,semi-annual,quarterly,bimontly,monthly).

- `'months='` [ cellstr | English names of months ] - Cell array of twelve strings representing the names of months.

- `'standinMonth='` [ numeric | `'last'` | `*1*` ] - Which month will represent a lower-than-monthly-frequency date if month is part of the date format string.

#### Description

There are two types of date strings in IRIS: year-period strings and calendar date strings. The year-period strings can be printed for dates with yearly, half-yearly, quarterly, bimonthly, monthly, weekly, and indeterminate frequencies. The calendar date strings can be printed for dates with weekly and daily frequencies. Date formats for calendar date strings must start with a dollar sign, `$`.

##### Year-period date strings

Regular date formats can include any combination of the following fields:

- `'Y'` - Year.

- `'YYYY'` - Four-digit year.

- `'YY'` - Two-digit year.

- `'P'` - Period within the year (half-year, quarter, bi-month, month, week).

- `'PP'` - Two-digit period within the year.

- `'R'` - Upper-case roman numeral for the period within the year.

- `'r'` - Lower-case roman numeral for the period within the year.

- `'M'` - Month numeral.

- `'MM'` - Two-digit month numeral.

- `'MMMM'`, `'Mmmm'`, `'mmmm'` - Case-sensitive name of month.

- `'MMM'`, `'Mmm'`, `'mmm'` - Case-sensitive three-letter abbreviation of month.

- `'Q'` - Upper-case roman numeral for the month or stand-in month.

- `'r'` - Lower-case roman numeral for the month or stand-in month.

- `'F'` - Upper-case letter representing the date frequency.

- `'f'` - Lower-case letter representing the date frequency.

- `'EE'` - Two-digit end-of-month day; stand-in month used for non-monthly dates.

- `'E'` - End-of-month day; stand-in month used for non-monthly dates.

- `'WW'` - Two-digit end-of-month workday; stand-in month used for non-monthly dates.

- `'W'` - End-of-month workday; stand-in month used for non-monthly dates.

##### Calendar date strings

Calendar date formats must start with a dollar sign, `$`, and can include any combination of the following fields:

- `'Y'` - Year.

- `'YYYY'` - Four-digit year.

- `'YY'` - Two-digit year.

- `'DD'` - Two-digit day numeral; daily and weekly dates only.

- `'D'` - Day numeral; daily and weekly dates only.

- `'M'` - Month numeral.

- `'MM'` - Two-digit month numeral.

- `'MMMM'`, `'Mmmm'`, `'mmmm'` - Case-sensitive name of month.

- `'MMM'`, `'Mmm'`, `'mmm'` - Case-sensitive three-letter abbreviation of month.

- `'Q'` - Upper-case roman numeral for the month.

- `'r'` - Lower-case roman numeral for the month.

- `'DD'` - Two-digit day numeral.

- `'D'` - Day numeral.

##### Escaping control letters

To get the format letters printed literally in the date string, use a percent sign as an escape character: `'%Y'`, `'%P'`, `'%F'`, `'%f'`, `'%M'`, `'%m'`, `'%R'`, `'%r'`, `'%Q'`, `'%q'`, `'%D'`, `'%E'`, `'%D'`.

#### Example

IRIS Toolbox. Copyright © 2007—2013 Jaromir Benes.