---
title: "Advanced date sorting - Cloud"
canonical: "https://support.appfire.com/space/SQL/74324872/Advanced%20date%20sorting%20-%20Cloud"
format: markdown
---
> Macro (aura-html)

## <span style="color: #000000">Overview</span>

<span style="color: #000000">The support for </span><span style="color: #000000">*Date*</span><span style="color: #000000"> type date sorting is built in which includes multiple language support and does </span><span style="color: #000000">**not**</span><span style="color: #000000"> require any additional server installation.</span><span style="color: #000000"> Th</span><span style="color: #000000">is is the recommended type to use for date sorting.</span>

> ℹ️ **Acknowledgement**
> ℹ️ 
> ℹ️ <span style="color: #000000">Advanced date sorting support with the </span><span style="color: #000000">*Date*</span><span style="color: #000000"> column type is provided using JavaScript implemented with the help of the</span> [Moment.js](http://momentjs.com/) <span style="color: #000000">library (open source, MIT license). A summary of the relevant parts of the Moment.js documentation is repeated here.</span>

## <span style="color: #000000">Automatic support</span>

<span style="color: #000000">If the </span><span style="color: #000000">*Date*</span><span style="color: #000000"> column type is specified, the default date parsing recognizes a number of common date formats including those recognized through the browser specific JavaScript implementation. However, there may be browser specific inconsistencies. The following ISO-8601 formats are recognized consistently across browsers:</span>

| **ISO-8601 Format** |
| --- |
| YYYY-MM-DD |
| YYYY-MM-DD HH |
| YYYY-MM-DD HH:mm |
| YYYY-MM-DD HH:mm:ss |
| YYYY-MM-DD HH:mm:ss Z |
| YYYY-MM-DD HH:mm:ss.SSS |
| YYYY-MM-DDTHH |
| YYYY-MM-DDTHH:mm |
| YYYY-MM-DDTHH:mm:ss |
| YYYY-MM-DDTHH:mm:ss Z |
| YYYY-MM-DDTHH:mm:ss.SSS |

## <span style="color: #000000">User specified formats</span>

<span style="color: #000000">Specify a format string following the </span><span style="color: #000000">*Date*</span><span style="color: #000000"> column type to handle a specific date format. Construct the date format string from the set of format tokens.</span>

> ✅ ### Non-alphanumeric characters
> ✅ 
> ✅ <span style="color: #000000">Non-alphanumeric characters are ignored, so, for example, both of the following are treated the same using the MM-DD-YYYY format:</span>
> ✅ 
> ✅ ```
> ✅ 12-25-1995
> ✅ 12/25/1995
> ✅ ```
> ✅ 
> ✅ <span style="color: #000000">Similarly, formats can be specified with or with non-alphanumeric separators. However, using separators helps with readability.</span>

## <span style="color: #000000">Format tokens</span>

:info: <span style="color: #000000">See the</span> [Moment.js documentation](http://momentjs.com/docs/) <span style="color: #000000">for further information.</span>

| Token | Description |
| --- | --- |
| M, MM | Month Number (1 - 12) |
| MMM, MMMM | Month Name (In the current language) |
| D, DD | Day of month |
| DDD, DDDD | Day of year |
| d, dd, ddd, dddd | Day of week<br>> ⚠️ The input for these tokens is ignored as there are 4-5 weeks in a month and it would be impossible to get the day of the month based off the day of the week. |
| YY | 2 digit year (if greater than 68, it returns 1900's, otherwise 2000's) |
| YYYY | 4 digit year |
| a, A | AM/PM |
| H, HH | 24 hour time |
| h, hh | 12 hour time (use in conjunction with a or A) |
| m, mm | Minutes |
| s, ss | Seconds |
| S | Deciseconds (1/10th of a second) |
| SS | Centiseconds (1/100th of a second) |
| SSS | Milliseconds (1/1000th of a second) |
| Z, ZZ | Timezone offset as `+07:00` or `+0700` |
| X | Unix timestamp |

## <span style="color: #000000">Language support (i18n)</span>

<span style="color: #000000">When the date format contains national language words, the appropriate language needs to be indicated. English (US) is the default, if nothing is specified. Specify the language between the date indicator </span><span style="color: #000000">*M*</span><span style="color: #000000"> and the format string.</span>

<span style="color: #000000">For example:  </span><span style="color: #000000">*(de)YYYY-MMM-DD*</span><span style="color: #000000">** **</span><span style="color: #000000">for a German date like </span><span style="color: #000000">*2013-Mrz-10*</span>

<span style="color: #000000">*(fr)*</span><span style="color: #000000"> for a French date like </span><span style="color: #000000">*Janv 10, 2013*</span>

## <span style="color: #000000">Supported languages</span>

<span style="color: #000000">Click the relevant link from the following list of Moment.js library supported languages to get the details of the specific localization:</span>

| Language indicator |
| --- |
| [ar-ma](https://github.com/moment/moment/blob/develop/locale/ar-ma.js) |
| [ar](https://github.com/moment/moment/blob/develop/locale/ar.js) |
| [bg](https://github.com/moment/moment/blob/develop/locale/bg.js) |
| [br](https://github.com/moment/moment/blob/develop/locale/br.js) |
| [ca](https://github.com/moment/moment/blob/develop/locale/ca.js) |
| [cs](https://github.com/moment/moment/blob/develop/locale/cs.js) |
| [cv](https://github.com/moment/moment/blob/develop/locale/cv.js) |
| [da](https://github.com/moment/moment/blob/develop/locale/da.js) |
| [de](https://github.com/moment/moment/blob/develop/locale/de.js) |
| [el](https://github.com/moment/moment/blob/develop/locale/el.js) |
| [en-ca](https://github.com/moment/moment/blob/develop/locale/en-ca.js) |
| [en-gb](https://github.com/moment/moment/blob/develop/locale/en-gb.js) |
| [eo](https://github.com/moment/moment/blob/develop/locale/eo.js) |
| [es](https://github.com/moment/moment/blob/develop/locale/es.js) |
| [et](https://github.com/moment/moment/blob/develop/locale/et.js) |
| [eu](https://github.com/moment/moment/blob/develop/locale/eu.js) |
| [fa](https://github.com/moment/moment/blob/develop/locale/fa.js) |
| [fi](https://github.com/moment/moment/blob/develop/locale/fi.js) |
| [fr-ca](https://github.com/moment/moment/blob/develop/locale/fr-ca.js) |
| [fr](https://github.com/moment/moment/blob/develop/locale/fr.js) |
| [gl](https://github.com/moment/moment/blob/develop/locale/gl.js) |
| [he](https://github.com/moment/moment/blob/develop/locale/he.js) |
| [hi](https://github.com/moment/moment/blob/develop/locale/hi.js) |
| [hu](https://github.com/moment/moment/blob/develop/locale/hu.js) |
| [id](https://github.com/moment/moment/blob/develop/locale/id.js) |
| [is](https://github.com/moment/moment/blob/develop/locale/is.js) |
| [it](https://github.com/moment/moment/blob/develop/locale/it.js) |
| [ja](https://github.com/moment/moment/blob/develop/locale/ja.js) |
| [ka](https://github.com/moment/moment/blob/develop/locale/ka.js) |
| [ko](https://github.com/moment/moment/blob/develop/locale/ko.js) |
| [lv](https://github.com/moment/moment/blob/develop/locale/lv.js) |
| [ms-my](https://github.com/moment/moment/blob/develop/locale/ms-my.js) |
| [nb](https://github.com/moment/moment/blob/develop/locale/nb.js) |
| [ne](https://github.com/moment/moment/blob/develop/locale/ne.js) |
| [nl](https://github.com/moment/moment/blob/develop/locale/nl.js) |
| [nn](https://github.com/moment/moment/blob/develop/locale/nn.js) |
| [pl](https://github.com/moment/moment/blob/develop/locale/pl.js) |
| [pt-br](https://github.com/moment/moment/blob/develop/locale/pt-br.js) |
| [pt](https://github.com/moment/moment/blob/develop/locale/pt.js) |
| [ro](https://github.com/moment/moment/blob/develop/locale/ro.js) |
| [ru](https://github.com/moment/moment/blob/develop/locale/ru.js) |
| [sk](https://github.com/moment/moment/blob/develop/locale/sk.js) |
| [sl](https://github.com/moment/moment/blob/develop/locale/sl.js) |
| [sq](https://github.com/moment/moment/blob/develop/locale/sq.js) |
| [sv](https://github.com/moment/moment/blob/develop/locale/sv.js) |
| [th](https://github.com/moment/moment/blob/develop/locale/th.js) |
| [tr](https://github.com/moment/moment/blob/develop/locale/tr.js) |
| [tzm-la](https://github.com/moment/moment/blob/develop/locale/tzm-la.js) |
| [tzm](https://github.com/moment/moment/blob/develop/locale/tzm.js) |
| [uk](https://github.com/moment/moment/blob/develop/locale/uk.js) |
| [zh-cn](https://github.com/moment/moment/blob/develop/locale/zh-cn.js) |
| [zh-tw](https://github.com/moment/moment/blob/develop/locale/zh-tw.js) |