How to change the date format in your DataSet

How date data is handled in Xibo Datasets.

When using a Remote DataSet or CSV file with your Xibo Signage you may need to include date data. How date data is read and formatted varies greatly across different applications and spreadsheet applications. Xibo uses year/month/day order by default.

To demonstrate how to format the date I have created a small CSV file containing date data in year/month/day hour:minute order.

image

When I import my CSV file into my DataSet, the date is still shown year/month/day order.

image

Formatting the date data using formulas.

The next step is to format the data so that it appears as I want it to in my layouts. I am going to use just the start date data column in my CSV file to demonstrate the formatting.

In this example the column in my CMS that holds that data is called Start. You will need to substitute that with the name of the column that you want to reformat. I will need to create a formula column to change the format for me. When you create the column, make sure it is set to a Formula Column type and String value. Please see this guide to understand how to format your date data.

There are two formulas you can use to achieve this.

Formula 1: date_format(columnName, "date formatting")

You can see that I have used the % symbol before each time format element in this formula, which is essential when using this method.

Formula 2: $dateFormat(columnName, date formatting,language)

With this formula I do not need to enter the formatting in brackets or use the % symbol. Using this formula you also have the option to additionally specify a language. The example shown above will be formatted in en English.

This formula is also referred to in the tips that appear when you configure a formula column:

Results.

This is how the data appears when using those formulas:

I can now use either of those formula columns with my layouts to ensure the data is formatted exactly as I want it to be.