How can I make a PHP script that displays a users Registered Date and Last Visited Date as it appears in the core Joomla profile page?

enter image description here


Before asking a question like this, please do some research. Seeing as you have been doing a lot of work with the user Object already, I'm surprised you haven't seen the following page yet:


You can simply use:

$user = JFactory::getUser();
echo '<p>Register date: ' . $user->registerDate . '</p>';
echo '<p>Last visited: ' . $user->lastvisitDate . '</p>'; 
| improve this answer | |
  • i am quite lazy! :) – saibbyweb May 29 '14 at 5:16
  • @Lodder I am suddenly horrified to find that I have 61 declined flags. The one above is just one of the many that are rightfully removed from this site. I suspect that most of them are my flagging of useless comments like "thanks", "your welcome", "I love you", "you are a genius", "i am quite lazy", etc. What possible reason can there be for declining these flags? – mickmackusa Dec 6 '18 at 6:36
  • @mickmackusa - The majority of your comment flags have been on "thank you" comments which I personally deem ok, as they show a sign of appreciation. Some of them however, I have deleted as they were replies to a comment which had been deleted for whatever reason and thus made no sense. – Lodder Dec 6 '18 at 9:08
  • You are of course welcome to ask about this on Meta and get the opinion of the other moderators, as they may think differently. – Lodder Dec 6 '18 at 9:11
  • You are one of two active moderators, right? – mickmackusa Dec 6 '18 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.