Export with currenr Date and Time

Export with currenr Date and Time

pjisippjisip Posts: 3Questions: 2Answers: 0

How can i add date time of export in the pdf?

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,142Questions: 26Answers: 4,736
    Answer ✓

    Where do you want the date time to be in the PDF?

    Maybe this example will help:
    https://datatables.net/extensions/buttons/examples/html5/titleMessage.html

    Kevin

  • pjisippjisip Posts: 3Questions: 2Answers: 0
    edited April 2019
    var currentdate = new Date(); 
        var datetime = "Now: " + currentdate.getDate() + "/"
                    + (currentdate.getMonth()+1)  + "/" 
                    + currentdate.getFullYear() + " @ "  
                    + currentdate.getHours() + ":"  
                    + currentdate.getMinutes() + ":" 
                    + currentdate.getSeconds();
    
    
     extend: 'pdf',
                    messageBottom: datetime;
    

    is this correct?

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Hi @pjisip ,

    Yep, that looks good. If it's not working, 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.