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 stringOutput
%a, %b %d, %YSun, Feb 10, 2019
%Y-Q%q2019-Q1
%I:%M:%S %p03: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.

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.

FormatExample outputDescription
%Y2018Four-digit year
%y18Two-digit year (00– 99)
%q3Quarter of the year (1–4)
%m07Two-digit month (01–12)
%bJulAbbreviated month name
%BJulyFull month name
%aSunAbbreviated day of week
%ASundayFull day of week
%d08Two-digit day of month (01–31)
%H00Two-digit hour based on 24-hour clock (00–23)
%I12Two-digit hour based on 12-hour clock (01–12)
%M34Two-digit minutes (00–59)
%S59Two-digit seconds (00–59)
%pAMAM or PM
%L000Three-digit milliseconds (000–999)
%f000000Six-digit microseconds (000000–999999)
%Z-07:00Time zone offset
%%%Percent sign

Related resources