1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Date Format

Discussion in 'XenForo Questions and Support' started by Amaury, Sep 7, 2015.

  1. Amaury

    Amaury Well-Known Member

    I feel like I've asked this before, but I'm not sure.

    One thing I liked about vBulletin is that you could have one date format for posts and another for the general forum. (In our case, it was the same before we moved.) I was just wondering if this were possible with template edits on XenForo (maybe even more flexible than on vBulletin) or if it'd require an add-on to be done properly?

    Thank you.
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    In the templates you can use this:

    {xen:date $serverTime, 'j -F Y h:i:s'}
    The quoted string is the format which uses the vars from this page:

    PHP: date - Manual

    So you can edit a specific template and insert this code in place of the existing date code. Just be sure to pass it the available timestamp variable ($serverTime is just the current time).

    The problem with this template code is that you lose the relative times (e.g. "a moment ago"). This post explores the code a bit more if you are interested:

    XF 1.1 - How to change the post date format?
    Amaury likes this.
  3. Amaury

    Amaury Well-Known Member

    Thanks, Jake!

    Just to clarify, I was referring the message user info box, not the post itself. My bad.

Share This Page