Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

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.

DirectiveMeaningExample
%aWeekday as locale’s abbreviated name.
Sun, Mon, …, Sat (en_US);
So, Mo, …, Sa (de_DE)
%AWeekday as locale’s full name.Sunday, Monday, etc.
%dDay of the month as a zero-padded decimal number.01, 02, …, 31
%bMonth as locale’s abbreviated name.
Jan, Feb, …, Dec
%BMonth as locale’s full name.
January, February, …, December
%mMonth as a zero-padded decimal number.01, 02, …, 12
%YYear with century as a decimal number.1970, 1988, 2001, 2013
%HHour (24-hour clock) as a zero-padded decimal number.00, 01, …, 23
%IHour (12-hour clock) as a zero-padded decimal number.01, 02, …, 12
%pEither AM or PM.
AM, PM
%MMinute as a zero-padded decimal number.00, 01, …, 59
%SSecond as a zero-padded decimal number.00, 01, …, 59
%sNumber of seconds (timestamp) since 1970-01-01 00:00:00 UTC.1538524800
%%A literal '%' character.%

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.

DirectiveMeaningExample
dddWeekday as locale’s abbreviated name.
Sun, Mon, …, Sat (en_US);
So, Mo, …, Sa (de_DE)
ddddWeekday as locale’s full name.Sunday, Monday, etc.
DDDay of the month as a zero-padded decimal number.01, 02, …, 31
MMMMonth as locale’s abbreviated name.
Jan, Feb, …, Dec
MMMMMonth as locale’s full name.
January, February, …, December
MMMonth as a zero-padded decimal number.01, 02, …, 12
YYYYYear with century as a decimal number.1970, 1988, 2001, 2013
HHHour (24-hour clock) as a zero-padded decimal number.00, 01, …, 23
hhHour (12-hour clock) as a zero-padded decimal number.01, 02, …, 12
aEither AM or PM.
AM, PM
mmMinute as a zero-padded decimal number.00, 01, …, 59
ssSecond as a zero-padded decimal number.00, 01, …, 59
[anything]
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.

PurposeFormatExamples formatExample 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 EUR123'456.789 EUR
%.,d EUR123.456,789 EUR
%',d EUR123'456,789 EUR
Rounding precision%[precision]d%2d EUR123456.79 EUR
%,1d EUR123456,8 EUR
%',0dEUR123'456 EUR
  • No labels