Custom Date/Time/Datetime Formatting

You can customize the display format of dates in dashboard widgets based on your need. You can choose from the wide range of date formats available including, custom date format.

How to format the Date field value shown in the Widgets

Bind the date field to the widget as shown in the image below.

Widget configuration

Click on the settings button in the added field.

Settings button

Format option is provided in the context menu. Click on the Settings menu item to open the window.

Settings menu item

Date Settings window will be opened as shown here:

Data Settings window

Format shows the predefined available options provided for the selected date/time format.

For example,

If Year is selected, then the following options will be shown.

Date formats drop down

Select the formatting option you want; it will be reflected in the widget.

For example, if we select 16,17,... option then the widget will be rendered like shown in the below image:

widget view

You can find the predefined formats in the below table.

</table> N> Date time formatting option is not available for the `Time`,`Week Year`,`Day Month Year`, `Month Day Year` types. N> N> Also, the date/time formatting option is not available for the `Chart` and `Range navigator` widget types. ## Custom formatting the date time format Select the `custom` option in the format window. ![Custom drop down](images/CustomDateFormat07.png) Now the `Custom Format` text box will be enabled. ![Custom format text box](images/CustomDateFormat08.png) Specify the custom format in the textbox and hit `OK` button. ![OK button](images/CustomDateFormat09.png) Widget will be re-rendered like shown here: ![Widget refreshed view](images/CustomDateFormat10.png) **Proper custom date time format**: An example date time value will appear in the preview area as per the date time format specified in the textbox. ![Proper custom format](images/CustomDateFormat11.png) **Invalid format**: For invalid date formats, it will show the below alert message: ![Invalid format](images/CustomDateFormat14.png) The list of valid format specifiers can be referred from table mentioned in this [page](https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx) You can find the formatting strings by hovering the `i` icon in the format window. ![Tooltip icon](images/CustomDateFormat13.png) The valid format strings are listed in the below table.
Type Formats available
Year
    2016,2017,...
    16,17,...
Quarter
    Quarter 1,Quarter 2
    Q1,Q2,Q3,Q4
    1,2,3,4
Month
    Jan,Feb,Mar
    January,February
    Ja,F,Mar,A
    1,2,3,...12
    01,02,03,...12
Hour
    00,01,02,03,..
    1 AM,2 PM
    Ja,F,Mar,A
    0,1,2,3,...
Minutes
    00,01,02,03,..
    0,1,2,3,...
Seconds
    00,01,02,03,..
    0,1,2,3,...
Quarter Year
    Quarter 1 2017
Month Year
    Jan 2016,May 2017
Date Hour
    23/07/2017 00
Week of Year
    00,01,02,03..
    Week 0,Week 1,Week 2,..
    Week 00,Week 01,Week 02,..
Day
    00,01,02,03,..31
    1,2,3,..31
Format String description
yy Displays the year, from 00 to 99.
yyyy Display the year as a four-digit number.
MM Display the month, from 01 through 12.
MMM Display the abbreviated name of the month
MMMM Display the full name of the month.
HH Display the hour, using a 24-hour clock from 00 to 23.
hh Display the hour, using a 12-hour clock from 01 to 12.
mm Display the minute, from 00 through 59.
ss Display the second, from 00 through 59.
ttt Display the AM/PM.
N> Custom formatting option is only available for the below Date Time formats: N> * Date time N> * Date N> * Year N> * Month Year N> * Date Hour