• Resolved umavcs

    (@umavcs)


    Hi i need to display the order time only in the invoice pdf
    i found this code for Invoice Date and time:

    add_filter( ‘wpo_wcpdf_date_format’, ‘wpo_wcpdf_date_format’, 10, 2 );
    function wpo_wcpdf_date_format( $date_format, $document ) {
    return ‘d/m/Y, H:i:s’;
    }

    Order Number:41494
    Order Date:3 November 2020
    Order Time:——— time only

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi! The easiest way to get the order time on the invoice is with our Premium Templates extension, using the {{order_time}} placeholder in a custom block:

    This requires no coding at all.
    If you want to code this yourself you can add this to a custom template:

    
    <?php echo $this->order->get_date_created()->date('H:i:s');?>
    

    Which will output the time of the order in 24 hour format.

    Thread Starter umavcs

    (@umavcs)

    yes this is work for me thx LOT
    <?php echo $this->order->get_date_created()->date(‘H:i:s’);?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to get order time only’ is closed to new replies.