rename exported file with date on runtime.

rename exported file with date on runtime.

stsh3011stsh3011 Posts: 11Questions: 4Answers: 0

I want to add current time with file name exported from datatables html5 buttons plugin and to rename file i have used an attribute filename and file gets renamed but problem is when again i click on export button then time should change but gets remain unchanged.Hope have cleared my problem.
my code is

{
                            extend: 'pdfHtml5',
                            orientation: 'landscape',
                            filename: '*_' + gettime(),
                            PdfSize: "A3",
                        }
function gettime()
{
    var date = new Date();
    var newdate = (date.getHours() % 12 || 12) + "_" + date.getMinutes() + "_" + date.getSeconds();
    //setInterval(gettime, 1000);
    return newdate;
}
This discussion has been closed.