Table of Contents
Introduction
In a number of places Squirro supports format strings to specify how numbers and dates are displayed or processed. This page documents these various format strings.
Python Datetime format
For datetime formatting, such as the input format of the data loader, Python datetime format strings are used.
For example the Squirro standard format of 2018-12-25T11:19:20
is written in this syntax as %Y-%m-%dT%H:%M:%S
.
This table lists the most commonly used format directives. See also the Python documentation for datetime format strings for a more complete reference.
Directive | Meaning | Example |
---|---|---|
| Weekday as locale’s abbreviated name. | Sun, Mon, …, Sat (en_US); So, Mo, …, Sa (de_DE) |
| Weekday as locale’s full name. | Sunday, Monday, etc. |
| Day of the month as a zero-padded decimal number. | 01, 02, …, 31 |
| Month as locale’s abbreviated name. | Jan, Feb, …, Dec |
| Month as locale’s full name. | January, February, …, December |
| Month as a zero-padded decimal number. | 01, 02, …, 12 |
| Year with century as a decimal number. | 1970, 1988, 2001, 2013 |
| Hour (24-hour clock) as a zero-padded decimal number. | 00, 01, …, 23 |
| Hour (12-hour clock) as a zero-padded decimal number. | 01, 02, …, 12 |
| Either AM or PM. | AM, PM |
| Minute as a zero-padded decimal number. | 00, 01, …, 59 |
| Second as a zero-padded decimal number. | 00, 01, …, 59 |
| Number of seconds (timestamp) since 1970-01-01 00:00:00 UTC. | 1538524800 |
| A literal | % |
Moment Datetime format
For display purposes in the user interface, the moment datetime format is used.
For example the Squirro standard format of 2018-12-25T11:19:20
is written in this syntax as YYYY-MM-DD[T]HH:mm:ss
.
This table lists the most commonly used format directives. See also the Moment.js documentation for date tokens for a more complete reference.
Directive | Meaning | Example |
---|---|---|
| Weekday as locale’s abbreviated name. | Sun, Mon, …, Sat (en_US); So, Mo, …, Sa (de_DE) |
| Weekday as locale’s full name. | Sunday, Monday, etc. |
| Day of the month as a zero-padded decimal number. | 01, 02, …, 31 |
| Month as locale’s abbreviated name. | Jan, Feb, …, Dec |
| Month as locale’s full name. | January, February, …, December |
| Month as a zero-padded decimal number. | 01, 02, …, 12 |
| Year with century as a decimal number. | 1970, 1988, 2001, 2013 |
| Hour (24-hour clock) as a zero-padded decimal number. | 00, 01, …, 23 |
| Hour (12-hour clock) as a zero-padded decimal number. | 01, 02, …, 12 |
| Either AM or PM. | AM, PM |
| Minute as a zero-padded decimal number. | 00, 01, …, 59 |
| Second as a zero-padded decimal number. | 00, 01, …, 59 |
| Use square brackets to escape tokens that could be confused as date formatting tokens |
Number format
For numeric facets a % syntax is used, which supports the following formats.
This table lists the most commonly used format directives. See also the Python documentation for datetime format strings for a more complete reference.
Purpose | Format | Examples format | Example output (for facet value 123456.789) |
---|---|---|---|
Facet value | %d |
| 123456.789 EUR |
$% | $123456.789 | ||
Thousands and floating point separators | %[thousand][floating_point]d | %'d EUR | 123'456.789 EUR |
%.,d EUR | 123.456,789 EUR | ||
%',d EUR | 123'456,789 EUR | ||
Rounding precision | %[precision]d | %2d EUR | 123456.79 EUR |
%,1d EUR | 123456,8 EUR | ||
%',0dEUR | 123'456 EUR |