want to add machine time to created pdf

Discussion in 'Free Source Codes' started by Rajanarayana, Nov 24, 2023.

    
  1. Rajanarayana

    Rajanarayana New Member


    [Function:SaveToPDF]
    Variable:SavePDF:String
    Local Formula:LWInvNo:$$StringFindandReplace:$VoucherNumber:"/":"-"
    Local Formula:LWLedger:$$StringFindandReplace:$PartyLedgerName:"\":"-"
    Local Formula:LWDate:$$String:$Date
    10:set:SavePDF:$$String:"D:\Vouchers" + "\" + @LWInvNo+"_"+@LWLedger+"_"+@LWDate
    20:Set:SVExportFormat:$$SysName:pdf
    30:Set:SVPrinterName:"Adobe PDF"
    40:Set:SVPrintFileName:$$MakeExportName:##SavePDF:##SVExportFormat
    50:Set:SVOPenfileAfterExport:Yes
    60:Export Report:.:true

    [#Form:Sales color]
    On:Form Accept:Yes:Call:SaveToPDF
    [#Form:payment color]
    On:Form Accept:Yes:Call:SaveToPDF

    This code is working fine. it creates pdf after saving voucher. File name example "1_Raj_1-Apr-23.pdf". I want add system time to file name, like "1_Cash_1-Apr-23 1.30PM.pdf"
     


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Same a you added DATE to the string --- Add a formula for the TIME -- and add that ---- $$machinetime to the String.
     


  3. Rajanarayana

    Rajanarayana New Member


    Thank you very much sir,

    Local Formula:LWTime:$$StringFindandReplace:$$MachineTime:":":"-"

    I have added this and its saving file with time string. It is saving time string in HH:MM format. Is there any way to get it in HH:MM:SS format?
     


Share This Page