Date format

Date format

minhalminhal Posts: 76Questions: 12Answers: 0
edited January 2020 in Free community support

Hi,

I am trying to pull date in my data tables but for some reason the format of the data is not correct. I am getting the data from a stored procedure.

Original:
/Date(1575612000000)/

Expected Output:
01-15-2020

Code Example:
 $(document).ready(function () {
        var mesa = $('.datatable').DataTable({
            filename: "LocationCodes",
            responsive: true,
            "bAutoWidth": false, // toggle this depending on how wide you want the table
            "ajax": {
                "url": "/controller/sp",
                "type": "GET",
                "datatype": "json"
            },
            "deferRender": true,
            "responsive": true,
            dom: 'Bfrtip',
            "bSort": false,
            buttons: [
                'excel', 'print'
            ],
            "columns": [
                { "data": "FileName" },
                { "data": "ProjectName" },
                { "data": "RecordInsertTime" }
            ]

Thanks,
Minhal

Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.