Installation
The easiest way to install any extension for for DataTables, including DateTime, is with the download builder. With the download builder, you select the components of the DataTables suites and styling you want, and it will generate the packages / install commands for you to use.
The download builder includes options for direct loading with script and link tags, details for using a package manager such as npm and NuGet, or a download option if you wish to have the files locally.
The download builder is strongly recommended for getting started with DateTime, and all other DataTables software, particularly so you make sure that the correct styling integration files are available on your page.
However, if you prefer to create the installation yourself, below is an overview of installation via the CDN and npm for the DataTables default styling of DateTime.
Dependency
Although DateTime can be used separately from DataTables, DataTables v3+ is a hard dependency for DateTime 2+. This is because it makes use of the DOM manipulation and event libraries available in DataTables to keep the code size as small as possible. If you wish to use DateTime, you must also load DataTables!
CDN
Assuming that you already have DataTables installed simply add the CSS and JS for DateTime by inserting the following two tags to your HTML, after the core DataTables file has been included.
<link href="https://cdn.datatables.net/datetime/2.0.0-beta.1/css/dataTables.dateTime.min.css" rel="stylesheet">
<script src="https://cdn.datatables.net/datetime/2.0.0-beta.1/js/dataTables.dateTime.min.js"></script>
Note that, unlike the other DataTables extensions, DateTime does not have specific styling for the various styling frameworks that are supported. The same style is used for all of them.
Once installed, you will be able to access a global DateTime constructor, or use that same object from DataTable.DateTime.
The other DataTables components that make use of DateTime will automatically see and use the library.
NPM
To install DateTime via npm use:
npm install datatables.net-datetime
To use DateTime in your own software, note that unlike most of the other DataTables extensions, DateTime will provide itself on its default export:
import DateTime from 'datatables.net-datetime';
You will now be able to initialise and configure DateTime.
Sources
If you are interested in building DateTime from source yourself, you can find it on Github. The source is Typescript and SCSS which is transpiled to Javascript and CSS. The DateTime source is released under the MIT license. See the DataTables manual for more details on building DataTables and the extensions.