Hi,
I'm looking to remove the time info from the news display. I only want the date. The templates have <?php echo $this->date; ?> in there, which brings up both, the date and time.
How can I remove the time, while keeping the date?
Hi,
I'm looking to remove the time info from the news display. I only want the date. The templates have <?php echo $this->date; ?> in there, which brings up both, the date and time.
How can I remove the time, while keeping the date?
Hi spirelli,
once you decided about the date-time format of your website you can manipulate the date string in the template via PHP (substr(); or whatever).
cheers
Antipitch
You mean I can do that in the news templates (news_latest.tpl or news_fill.tpl for example)?
If so, I would have no clue how. The only reference to the date and time info seems to be <?php echo $this->date; ?>. As I don't know PHP I'm not really sure how to reduce this to the date only...
Would be grateful for some help here!
Thanks.
Hi spirelli !
You can change the date format from settings module. If you want to change only in one particular place (for example on the Newslist) you can replace the <?php echo $this->date; ?> with the format that you want.
for example, suppose that you want to change the date of the Newslist, and you are using the news_short.tpl so change the
<?php echo $this->date; ?>
for
<?php echo date_format(date_create($this->date), "m-d") ?>
what i did here is change the Y.m.d. that i have as default for m-d
if you need references about date format you can check here
regardss
===
Fernabel
ok, that worked.
Thanks so much for your help!
Bookmarks