Title: Timestamp in Order Notes
Last modified: May 21, 2020

---

# Timestamp in Order Notes

 *  Resolved [marciosironi](https://wordpress.org/support/users/marciosironi/)
 * (@marciosironi)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/timestamp-in-order-notes/)
 * I have this function that shows all the Order Notes on the myaccount page.
    It’s
   working, but the timestamp is wrong. How can I insert the same timestamp that
   is configured in wordpress?
 * > function animers_woocommerce_order_details_before_order_table( $order ) { ?
   > >
   >  <h2 class=”woocommerce-order-details__title”>Atualizações do Pedido</h2>
   > <div class=”collapsible-orders”> <ul class=”order_notes” style=”display: flex;
   > flex-direction: column-reverse;”> <?php $order_id = $order->get_id();
   >  $order_notes = get_private_order_notes( $order_id );
   >  echo $order->get_status();
   > if ( $order->get_status() == ‘completed’ || $order->get_status() == ‘processing’):
   > foreach($order_notes as $note) { $note_id = $note[‘note_id’]; $note_date = 
   > $note[‘note_date’]; $note_author = $note[‘note_author’]; $note_content = $note[‘
   > note_content’];
   >  $haystack = $note_content;
   >  ?>
   >  <li class=”note system-note”>
   >  <div class=”note_content”> <?php echo ”.$note_content.’‘;?
   > > </div> <p class=”meta”> <abbr class=”exact-date” title=”<?php echo $note[‘
   > note_date’]; ?>”><?php echo $note[‘note_date’]; ?> </abbr>
   >  <?php }
   >  endif; ?>
   >  </div>
   > <?php }
 * EDIT:
    I tried this code, but all notes have the current time, not the time the
   note was created.
 * > <?php echo date_i18n( esc_html__( ‘l jS \o\f F Y, h:ia’, ‘woocommerce’ ), strtotime(
   > $note->comment_date ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?
   > >

Viewing 1 replies (of 1 total)

 *  Thread Starter [marciosironi](https://wordpress.org/support/users/marciosironi/)
 * (@marciosironi)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/timestamp-in-order-notes/#post-12872025)
 * I got it with this code
 * > <abbr class=”exact-date” title=”<?php printf( __( ‘added on %1$s at %2$s’, ‘
   > woocommerce’ ), date_i18n( wc_date_format(), strtotime( $note[‘note_date’] )),
   > date_i18n( wc_time_format(), strtotime( $note[‘note_date’] ) ) ); ?>”>
   >  <?php
   > printf( __( ‘added on %1$s at %2$s’, ‘woocommerce’ ), date_i18n( wc_date_format(),
   > strtotime( $note[‘note_date’] ) ), date_i18n( wc_time_format(), strtotime( 
   > $note[‘note_date’] ) ) ); ?> </abbr>

Viewing 1 replies (of 1 total)

The topic ‘Timestamp in Order Notes’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [marciosironi](https://wordpress.org/support/users/marciosironi/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/timestamp-in-order-notes/#post-12872025)
 * Status: resolved