Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
Giuseppe Caiazza

WRONG TIME DISPLAY

Display universal time but not with the time zone set in wordpress, how can you fix?

3 years ago
Giuseppe Caiazza

I used the field Woocommerce -> Date -> Created

3 years ago
Stefan van den Dungen Gronovius
Developer

We take the timestamp from the WC Order and map this to a display Date.
I believe the date is stored as a GMT date in the database.
If you want to map it to another timezone or display you can alter the value yourself with a hook:

https://github.com/codepress/admin-columns-hooks/blob/master/ac-column-value.php

The base snippet for this specific columns could look something like this:

function ac_column_wc_date_value( $value, $id, AC\Column $column ) {
	if( $column instanceof ACA\WC\Column\ShopOrder\OrderDate ){
		$value = wp_date( 'd-m-y H:i:s', $column->get_raw_value( $id ) );
	}

	return $value;
}

add_filter( 'ac/column/value', 'ac_column_wc_date_value', 10, 3 );
3 years ago
Giuseppe Caiazza

What i do show the time to UTC+1 , tell me?

3 years ago
Stefan van den Dungen Gronovius
Developer

The WP_date method should exactly that.
Or you could use the WooCommerce methods to display the date as it automatically takes the Timezone settings into account.

wc_get_order( $id )->get_date_completed()->date_i18n( 'Y-m-d H:i:s')

3 years ago
Giuseppe Caiazza

i dont understand what i do, please tell step by step what i do. Thanks

3 years ago
Stefan van den Dungen Gronovius
Developer

You can copy-paste the snippet I posted before (the multi-line snippet) and paste it in a place where you manage your custom code. If you have a custom theme, you could paste it at the end of the function.php file in the root of your theme. If you don’t know how to implement hooks on your website, I recommend hiring a developer who can do that for you.

3 years ago
Giuseppe Caiazza

i add the snippet in the functions.php file of child theme, but after i add this snippet in the orders backend dont show the date

3 years ago

You must be logged in to reply to this topic.