• Resolved jakobhilbolling

    (@jakobhilbolling)


    How can I dsplay the time behind the orderdate of the order on the packing slips. Time should be displayed in the 24 hours format.

    <tr class=”order-date”>
    <th><?php _e( ‘Order Date:’, ‘wpo_wcpdf’ ); ?></th>
    <td><?php $wpo_wcpdf->order_date(); ?></td>
    </tr>

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

    (@pomegranate)

    You need to add a filter, check this thread:
    https://wordpress.org/support/topic/display-the-time-of-the-order-in-pdf/#post-6629203
    And more about using filters: How to use filters

    Hope that helps!

    Thread Starter jakobhilbolling

    (@jakobhilbolling)

    Thanks for the solution. It works. But now every time I use order-date the time is mentioned.
    I only want to mention the time in the order document, on the invoice only the date should be mentioned.
    Also the time is not in the 24 hours format:

    8 februari 2017 9:44:43 PM

    Plugin Contributor Ewout

    (@pomegranate)

    Hello Jakob,
    The example is indeed AM/PM but if you use the commented line instead of the other format:

    
    $time_format = get_option( 'time_format' );
    

    It follows your WooCommerce settings.

    That said, if you need the order time separately, you can use:

    
    <?php echo date_i18n( get_option( 'time_format' ), strtotime( $this->order->order_date ) ); ?>
    

    Hope that helps!

    Thread Starter jakobhilbolling

    (@jakobhilbolling)

    Thanks!

    I have implemented the solution and it works

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘display time’ is closed to new replies.