Overview
FIA can parse a wide range of date formats. Date formats are constructed by appending a number of format specifiers, corresponding to the day, month and year fields of the supplied date, together with the field delimiters.
Date formats
Formats correspond to those used by the C strptime function. The following formats are allowable:
Format | Example | Sample |
%d | Day of month (1-31) | 15 |
%m | Month number (1-12) | 2 |
%b | Month in abbreviated or full form | February, Feb |
%y | The year without century data (0-99). When a century is not otherwise specified, values in the range 69-99 refer to years in the twentieth century (1969-1999); values in the range 00-68 refer to years in the twenty-first century (2000-2068) | 45 |
%Y | The year, including century | 2015 |
Any single-character date separator is allowable. Typical values are '-' or '/'.
Sample date formats
The following table lists some allowable dates and their format strings
Date | Format |
15/05/2013 | %d/%m/%Y |
15/05/13 | %d/%m/%y |
05/15/2013 | %m/%d/%Y |
05-15-2013 | %m-%d-%Y |
05132013 | %m%d%Y |
20130515 | %Y%m%d |
15-May-13 | %d-%b-%y |
15-May-2013 | %d-%b-%Y |
Initially, all date formats have the default value %Y-%m-%d.
However, FIA allows you to specify a date format to be used for all files, a specific date format for each file, or any combination of the two. Formats are applied using the following schema:
- Any formats supplied in  are applied first to the corresponding files;
- Next, DateFormat  is applied to any files that have not had a custom format applied;
- If  DateFormat has not been supplied, the default format is applied to any remaining files.
SecurityDateFormat, PortfolioDateFormat, YieldCurveDateFormat, FXDateFormat
Example 1
No date format strings set. All dates from all files will be read using the default format string %Y-%m-%d
Example 2
DateFormat is set to DEMO_STRING. No other format strings set. In this case, all dates in all files will be read and parsed using DEMO_STRING.
Example 3
DateFormat is set to DEMO_STRING1, SecurityDateFormat is set to DEMO_STRING2. In this case,
- All dates in the security file will be read and parsed using DEMO_STRING2.
- All dates in other files will be read and parsed using DEMO_STRING1
Example 4
DateFormat is not set. SecurityDateFormat is set to DEMO_STRING1. In this case,
- All dates in the security file will be read and parsed using DEMO_STRING1
- All other dates will be read and parsed according to the default format string %Y-%m-%d