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
Locked
xgipper
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 223
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

sozzled
I've been banned!
Posts: 13639
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.

xgipper
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 223
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: 223
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.

sozzled
I've been banned!
Posts: 13639
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/

xgipper
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 223
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.)

sozzled
I've been banned!
Posts: 13639
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

xgipper
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 223
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.


Locked

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