Format Strings#

Squirro supports format strings in many places within the software platform to specify how numbers and dates are displayed or processed. This page documents these various format strings.

Python Datetime Format#

For datetime formattings, 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.

The following table lists the most commonly used format directives:

Directive

Meaning

Example

%a

Weekday as locale’s abbreviated name.

Sun, Mon, …, Sat (en_US);

So, Mo, …, Sa (de_DE)

%A

Weekday as locale’s full name.

Sunday, Monday, etc.

%d

Day of the month as a zero-padded decimal number.

01, 02, …, 31

%b

Month as locale’s abbreviated name.

Jan, Feb, …, Dec

%B

Month as locale’s full name.

January, February, …, December

%m

Month as a zero-padded decimal number.

01, 02, …, 12

%Y

Year with century as a decimal number.

1970, 1988, 2001, 2013

%H

Hour (24-hour clock) as a zero-padded decimal number.

00, 01, …, 23

%I

Hour (12-hour clock) as a zero-padded decimal number.

01, 02, …, 12

%p

Either AM or PM.

AM, PM

%M

Minute as a zero-padded decimal number.

00, 01, …, 59

%S

Second as a zero-padded decimal number.

00, 01, …, 59

%s

Number of seconds (timestamp) since 1970-01-01 00:00:00 UTC.

1538524800

%%

A literal '%' character.

%

Reference: See the official Python documentation for Datetime Format Strings for a more complete reference.

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.

The following table lists the most commonly used format directives:

Directive

Meaning

Example

ddd

Weekday as locale’s abbreviated name.

Sun, Mon, …, Sat (en_US);

So, Mo, …, Sa (de_DE)

dddd

Weekday as locale’s full name.

Sunday, Monday, etc.

DD

Day of the month as a zero-padded decimal number.

01, 02, …, 31

MMM

Month as locale’s abbreviated name.

Jan, Feb, …, Dec

MMMM

Month as locale’s full name.

January, February, …, December

MM

Month as a zero-padded decimal number.

01, 02, …, 12

YYYY

Year with century as a decimal number.

1970, 1988, 2001, 2013

HH

Hour (24-hour clock) as a zero-padded decimal number.

00, 01, …, 23

hh

Hour (12-hour clock) as a zero-padded decimal number.

01, 02, …, 12

a

Either AM or PM.

AM, PM

mm

Minute as a zero-padded decimal number.

00, 01, …, 59

ss

Second as a zero-padded decimal number.

00, 01, …, 59

[anything]

Use square brackets to escape tokens that could be confused as date formatting tokens

Reference: See the official Moment.js documentation for Date Tokens for a more complete reference.

Number Format#

For numeric facets, a % syntax is used, which supports the following formats.

The following table lists the most commonly used format directives:

Purpose

Format

Examples format

Example output (for facet value 123456.789)

Facet value

%d

%d EUR

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

Reference: See the official Python documentation for Datetime Format Strings for a more complete reference.