Is wp_users > user_registered GMT or local datetime?
-
Hello,
in which timezone should be
user_registered
column in tablewp_users
? In documentation it is not explicitly described and common convention in WP is, that infoo_date
columns the local date is used and for UTC/GMT datetimes are reserved columns namedfoo_date_gmt
.Though, function
wp_insert_user
is foruser_registered
field usinggmdate( 'Y-m-d H:i:s' )
It is apparently confusing e.g. for WooCommerce API creators: “If the DateTime string has no timezone or offset, WordPress site timezone will be assumed”. It leads to wrong WooCommerce API output for
/customers
endpoint.So where this issue should be fixed? I think this should be on the side of WP, either adding GMT information to the documentation on WP database/users table, or changing
wp_insert_user
function.
- The topic ‘Is wp_users > user_registered GMT or local datetime?’ is closed to new replies.