Results 1 to 5 of 5

Thread: Removing time from news items

  1. #1
    User
    Join Date
    06-19-09.
    Posts
    106

    Default Removing time from news items

    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?

  2. #2
    User
    Join Date
    06-19-09.
    Posts
    41

    Default Re: Removing time from news items

    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

  3. #3
    User
    Join Date
    06-19-09.
    Posts
    106

    Default Re: Removing time from news items

    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.

  4. #4
    User
    Join Date
    06-20-09.
    Location
    Spain
    Posts
    43

    Default Re: Removing time from news items

    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

  5. #5
    User
    Join Date
    06-19-09.
    Posts
    106

    Default Re: Removing time from news items

    ok, that worked.
    Thanks so much for your help!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •