Define custom date formats
Define custom date formats to control how date data is presented in Sigma.
When you enter a custom format string, you can use the supported date formats independently or in combination with other formats and characters, including letters, numbers, and symbols.
Example
Custom format strings applied to the value "2019-02-10 15:22:23" return the following output:
Format string | Output |
---|---|
%a, %b %d, %Y | Sun, Feb 10, 2019 |
%Y-Q%q | 2019-Q1 |
%I:%M:%S %p | 03:22:23 PM |
When applying the DateFormat and DateParse functions, date formatting occurs in your CDW/DBMS, which may not support the date formats described in this document.
Contents
Define a custom date format
Define a custom date format using one of the following methods:
- Column menu: Open the column menu and select Format > Custom, then enter the format string in the Custom Format modal.
- Toolbar: Click the Format option in the workbook toolbar and select Custom date, then enter the format string in the Custom Format modal.
Common date formats
The following table defines commonly used date formats. For a complete set of supported formats, reference the d3-time-format module.
Format | Example output | Description |
---|---|---|
%Y | 2018 | Four-digit year |
%y | 18 | Two-digit year (00– 99) |
%q | 3 | Quarter of the year (1–4) |
%m | 07 | Two-digit month (01–12) |
%b | Jul | Abbreviated month name |
%B | July | Full month name |
%a | Sun | Abbreviated day of week |
%A | Sunday | Full day of week |
%d | 08 | Two-digit day of month (01–31) |
%H | 00 | Two-digit hour based on 24-hour clock (00–23) |
%I | 12 | Two-digit hour based on 12-hour clock (01–12) |
%M | 34 | Two-digit minutes (00–59) |
%S | 59 | Two-digit seconds (00–59) |
%p | AM | AM or PM |
%L | 000 | Three-digit milliseconds (000–999) |
%f | 000000 | Six-digit microseconds (000000–999999) |
%Z | -07:00 | Time zone offset |
%% | % | Percent sign |