LPH
Well-known member
The register date is returning the string. How do I get this to show month, date, year? Do I try to wrap it in date()?
Update: Something like this returns today's date in the format ... :
Update: Head Smack !
Even better - why use those variables???
PHP:
$visitor = XenForo_Visitor::getInstance()->toArray();
echo '<strong>Login Username</strong>: ' . $visitor['username'] . '<br />';
echo '<strong>User email</strong>: ' . $visitor['email'] . '<br />';
echo '<strong>Joined</strong>: ' . $visitor['register_date'] . '<br />';
echo '<strong>Messages</strong>: ' . $visitor['message_count'] . '<br />';
echo '<strong>Likes</strong>: ' . $visitor['like_count'] . '<br />';
Update: Something like this returns today's date in the format ... :
PHP:
$visitor['register_date'] = date("D M j G:i:s T Y");
echo '<strong>Joined</strong>: ' . $visitor['register_date'] . '<br />';
Update: Head Smack !
PHP:
$registration_date = date( "D M j Y", $visitor['register_date'] );
echo '<strong>Joined</strong>: ' . $registration_date . '<br />';
$last_date = date( "D M j Y", $visitor['last_activity'] );
echo '<strong>Last Activity</strong>: ' . $last_date . '<br />';
Even better - why use those variables???
PHP:
echo '<strong>Joined</strong>: ' . date( "D M j Y", $visitor['register_date'] ) . '<br />';
echo '<strong>Last Activity</strong>: ' . date( "D M j Y", $visitor['last_activity'] ) . '<br />';
Last edited: