Skip to main content
Graphics Date Formatting
Updated over 2 weeks ago

When displaying date information, you may need to convert it to a different format.

In the Graphics Editor you can configure how a date is interpreted and displayed. Once a field is marked as Date, the configuration options will be available.

Input & Output

Date information can come in a great variety of formats and you might have requirements or preference to display it in a different way. To deal with this, you will find under the Date formatting section two configuration options:

  • Input defines how a Date formatted by the provider must be 'read'. Identify the format used and configure it here. The provider’s timezone may also affect the final display, refer to the Timezone section for details. Properly configuring the input ensures accurate date and time representation, but also in order to use correctly the provided Date as an ordering criteria or conditional display criteria.

  • Output defines how the Date will be displayed. Adjust these settings to select the final format and configure the timezone in which the graphics will be used.

Formatting Options

We provide ready-to-use time format templates. As you can see in the image below, Input Templates follow common API and code formats, while Output Templates are designed for display purposes.

If none of them suit your needs, you can choose "Add new…" to set up a custom format.

Timezones

The Input Timezone determines how the date from a provider is read. By default, it is set to UTC, though in some cases, it may be automatically configured.

  • When binding a Date from a Flowics Provider (like the Collection Provider), it will be set up automatically.

  • When using a JSON Provider, the timezone could come defined by the Schema. To ensure automatic timezone configuration, add the timezone to the JSON schema, locating the date object and including a Timezone entry as follows:


    type: 'Date',
    format: 'DD/MM/YYYY HH:mma',
    timeZone: 'UTC',
    title: 'Creation Date',
    },

  • You can manually configure the Timezone for a JSON Provider from the menu.

  • For the Google Sheets Provider, the timezone must also be set manually.

The Output Timezone takes the hour from the Input (including the defined timezone) and converts it to your local time (localised by your Browser). If you need to display the content for another timezone, you can manually change it from the menu.

Setting a New Format

When setting a New Format, assign a Name to identify it and establish the Format using Time Mask Tokens, which are explained in the next section. Once saved, the new format will appear at the bottom of the Time Formats list.

Year, month, and day tokens

Tokens are case-sensitive.

Input

Example

Description

YYYY

2014

4 digit year

YY

14

2 digit year

Y

25

Year with any number of digits

Q

1..4

Quarter of year. Sets month to first month in quarter.

M MM

1..12

Month number

MMM MMMM

Jan..December

Month name (localised to browser language)

D DD

1..31

Day of month

Do

1st..31st

Day of month with ordinal (localised to browser language)

DDD DDDD

1..365

Day of year

X

1410715640.579

Unix timestamp

x

1410715640579

Unix ms timestamp

Hour, minute, second, millisecond, and timezone tokens

Tokens are case-sensitive.

Input

Example

Description

H HH

0..23

Hours (24 hour time)

h hh

1..12

Hours (12 hour time used. You need to add a A in order to display am or pm )

k kk

1..24

Hours (24 hour time from 1 to 24)

a A / p P

am pm

Post or ante meridiem (Note the one character a p are also considered valid)

m mm

0..59

Minutes

s ss

0..59

Seconds

S SS SSS ... SSSSSSSSS

0..999999999

Fractional seconds (amount of seconds decimals to show)

Z ZZ

+3:00

Offset from UTC as +-HH:mm, +-HHmm, or Z

Week year, week, and weekday tokens

For these, the lowercase tokens use the locale-based week start days, while the uppercase tokens use the ISO week date start days.

Input

Example

Description

w ww

1..53

Week of year

e

0..6

Day of the week

ddd dddd

Mon...Sunday

Day name of the week (localised to browser language)

Some examples

Time Mask

Display

Description

YYYY-MM

2020-07

Year and Month

dddd, DD MMM 'YY - hh:mm a

Friday, 17 July '20 - 2:00 pm

Complete day

YYYY • MM • DD

2020 • 07 • 17

Custom separator

Did this answer your question?