1.4 Date and period format

Throughout the Web API we refer to dates and periods. The date format is:

yyyy-MM-dd

For instance, if you want to express March 20, 2014 you must use 2014-03-20 .

The period format is described in the following table (also available on API endpoint /api/periodTypes )

Period format
Interval Format Example Description
Day yyyyMMdd 20040315 March 15 2004
Week yyyy W n 2004W10 Week 10 2004
Week Wednesday yyyy WedW n 2015WedW5 Week 5 with start Wednesday
Week Thursday yyyy ThuW n 2015ThuW6 Week 6 with start Thursday
Week Saturday yyyy SatW n 2015SatW7 Week 7 with start Saturday
Week Sunday yyyy SunW n 2015SunW8 Week 8 with start Sunday
Bi-week yyyy BiW n 2015BiW1 Week 1-2 20015
Month yyyyMM 200403 March 2004
Bi-month yyyyMM B 200401B January-February 2004
Quarter yyyy Q n 2004Q1 January-March 2004
Six-month yyyy S n 2004S1 January-June 2004
Six-month April yyyy AprilSn 2004AprilS1 April-September 2004
Year yyyy 2004 2004
Financial Year April yyyyApril 2004April Apr 2004-Mar 2005
Financial Year July yyyyJuly 2004July July 2004-June 2005
Financial Year Oct yyyyOct 2004Oct Oct 2004-Sep 2005

In some parts of the API, like for the analytics resource, you can utilize relative periods in addition to fixed periods (defined above). The relative periods are relative to the current date, and allows e.g. for creating dynamic reports. The available relative period values are:

THIS_WEEK, LAST_WEEK, LAST_4_WEEKS, LAST_12_WEEKS, LAST_52_WEEKS,
THIS_MONTH, LAST_MONTH, THIS_BIMONTH, LAST_BIMONTH, THIS_QUARTER, LAST_QUARTER,
THIS_SIX_MONTH, LAST_SIX_MONTH, MONTHS_THIS_YEAR, QUARTERS_THIS_YEAR,
THIS_YEAR, MONTHS_LAST_YEAR, QUARTERS_LAST_YEAR, LAST_YEAR, LAST_5_YEARS, LAST_12_MONTHS,
LAST_3_MONTHS, LAST_6_BIMONTHS, LAST_4_QUARTERS, LAST_2_SIXMONTHS, THIS_FINANCIAL_YEAR,
LAST_FINANCIAL_YEAR, LAST_5_FINANCIAL_YEARS