Display published time Topic is solved

General questions relating to Joomla! 3.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
xgipper
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 217
Joined: Fri Aug 26, 2005 8:59 am

Display published time

Post by xgipper » Sun Dec 05, 2021 8:39 pm

Hello
Articles on my J3.10.3 news site display the date they are published at the top, but not the time published, which I would like.
(If I ask them to they also display the date last modified, but I don't usually use that).
But I can't find an option to display time published, just date and time under Content > Articles.
Am I missing a setting somewhere, or might this be a template issue that I need to look into (or something else)? It was built with Themler.
Thanks

User avatar
sozzled
Joomla! Master
Joomla! Master
Posts: 11338
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Display published time

Post by sozzled » Sun Dec 05, 2021 8:58 pm

You can do this with a language override.

Go to Extensions » Languages » Override and select the language you wish to create an override for, e.g. English (United Kingdom) - Site.

Now search for the constant DATE_FORMAT_LC3, which probably has the value

Code: Select all

d F Y
and change it to

Code: Select all

d F Y H:m
Save the override and refresh the article at the frontend.
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)

xgipper
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 217
Joined: Fri Aug 26, 2005 8:59 am

Re: Display published time

Post by xgipper » Sun Dec 05, 2021 9:40 pm

Thank you. That worked for me. And I switched the month and day around and added a comma. I may try to change it to am/pm rather than 24hr clock: can this be done in the same way? Dare I ask, can months and days of the week be abbreviated using this method to take up less space? Cheers.

xgipper
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 217
Joined: Fri Aug 26, 2005 8:59 am

Re: Display published time

Post by xgipper » Sun Dec 05, 2021 10:00 pm

Although having said that it worked, the 'minutes' past the hour don't seem to correspond with the 'start publishing' minutes past the hour in the back end, which seems odd.

User avatar
sozzled
Joomla! Master
Joomla! Master
Posts: 11338
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Display published time

Post by sozzled » Sun Dec 05, 2021 10:55 pm

xgipper wrote:
Sun Dec 05, 2021 9:40 pm
Thank you. That worked for me. And I switched the month and day around and added a comma. I may try to change it to am/pm rather than 24hr clock: can this be done in the same way? Dare I ask, can months and days of the week be abbreviated using this method to take up less space? Cheers.
Yes to all of those questions.

See PHP date formats here: https://cheatography.com/unclepips/chea ... /php-date/
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)

xgipper
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 217
Joined: Fri Aug 26, 2005 8:59 am

Re: Display published time

Post by xgipper » Mon Dec 06, 2021 6:32 pm

Any clues as to why might the published time in the front end not quite match that in the back end, please? The date and hour seems correct, but the minutes seem generally wrong. (I put"F d, Y H:m" as the override.)

User avatar
sozzled
Joomla! Master
Joomla! Master
Posts: 11338
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Display published time

Post by sozzled » Mon Dec 06, 2021 7:33 pm

As you will see from the date format "cheat sheet" that I referred to in my previous post, the format I posted previously was wrong. Instead of "m" for minutes, it should have been "i". "m" is the numeric representation of the month! Therefore, to fix your issue, the format should be changed to read

Code: Select all

F d, Y H:i
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)

xgipper
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 217
Joined: Fri Aug 26, 2005 8:59 am

Re: Display published time

Post by xgipper » Mon Dec 06, 2021 8:51 pm

Excellent. I believe that has fixed it - and the cheat sheet has also enabled me to change some other formats around to suit my preference. Thank you.


Post Reply

Return to “General Questions/New to Joomla! 3.x”