format
Since: DateTime 1.0.0
The format of the date data.
Please note - this property requires the DateTime extension for DataTables.
Description
This string is used to represent the structure of the date that is being used by DateTime. This format is set in accordance with the format used by Moment, Luxon or DayJS depending on which is in use.
Type
string
- Description:
This string is used to represent the structure of the date that is being used by DateTime.
Default
- Value:
'YYYY-MM-DD'
The default value for format is to use the ISO-8601 format.
Example
Change format to use '/' instead of '-'.:
new DateTime(document.getElementById('test'), {
format: 'YYYY/MM/DD'
});