I can't seem to be able to get the time for the created date to display correctly. All the dates return the same time.

The date format I used is shown below.

<ul class="relateditems<?php echo $moduleclass_sfx; ?>">
<?php foreach ($list as $item) :    ?>

    <a href="<?php echo $item->route; ?>">
        <?php echo $item->category_title;?><?php echo $item->category_title;?>
        <span><?php if ($showDate) echo JHTML::_('date', $item->created, JText::_('M d Y | h:ia T')); ?></span>
        <br />
        <?php echo $item->title; ?></a>

<?php endforeach; ?>

This returns the date in this format; May 27 2013 | 01:00am WAT which is what I want BUT the problem is that all the dates on the module have the same time 01:00am WAT.

How do I get the date to display the correct time

1 Answer 1


$item->created simply gets creation date of the article from the #__content table in the database. If all the dates appear to be the same, then open the #__content table via PhpMyAdmin and check the created column.

If the dates are all the same, then go to your Article Manager in the Joomla backend, open a related article, and manually change the creation date on the right hand side.

It's quite possible that the articles you're using are simply updates of the dummy articles that came with your Joomla installation.

Hope this helps

  • Hi. Thanks for your response. Please note that the dates are not the same. The dates are different and CORRECT. Its the TIMEs that are the same.
    – Josh
    Commented Oct 7, 2014 at 12:22
  • @Josh - ahh sorry, I will double check that when I get back home ;)
    – Lodder
    Commented Oct 7, 2014 at 12:32
  • Hi. Any progress on this?
    – Josh
    Commented Oct 15, 2014 at 11:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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