A2oz

What Format is User Registered Date in WordPress?

Published in WordPress 1 min read

The user registered date in WordPress is stored in a Unix timestamp format.

This format represents the number of seconds that have elapsed since January 1, 1970, at 00:00:00 Coordinated Universal Time (UTC).

Here's what you need to know about this format:

  • It's a numerical representation of the date and time.
  • It's not human-readable directly.
  • You'll need to convert it to a human-readable format using PHP functions.

Here's an example of how to convert a Unix timestamp to a human-readable date format in WordPress:

<?php
$registered_timestamp = get_user_meta( $user_id, 'user_registered', true ); 
$registered_date = date( 'F j, Y', $registered_timestamp );
echo $registered_date;
?>

This code snippet retrieves the user's registered date, converts it to a human-readable format using the date() function, and then displays it.

Note: You can customize the date format using different parameters within the date() function.

Related Articles