Support » Fixing WordPress » Is wp_users > user_registered GMT or local datetime?

  • janrenn



    in which timezone should be user_registered column in table wp_users? In documentation it is not explicitly described and common convention in WP is, that in foo_date columns the local date is used and for UTC/GMT datetimes are reserved columns named foo_date_gmt.

    Though, function wp_insert_user is for user_registered field using gmdate( '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.

Viewing 1 replies (of 1 total)
  • Joy


    The wp_insert_user() function is clearly using either a supplied date or gmdate() since version 2.0.
    It does not appear to be broken.
    If the WooCommerce plugin defines it differently, the problem would be in the plugin. You can ask on that plugin’s forum.

Viewing 1 replies (of 1 total)
  • The topic ‘Is wp_users > user_registered GMT or local datetime?’ is closed to new replies.