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

strfrtime in a template?

Discussion in 'XenForo Development Discussions' started by SneakyDave, Feb 14, 2014.

  1. SneakyDave

    SneakyDave Well-Known Member

    I have an external application that updates a custom user profile field with an integer time.

    Is there a way to format the date/time with strfrtime in an xF template or do I need to create some kind of callback to do that?
  2. AndyB

    AndyB Well-Known Member

    Here's an example taken from one of my add-ons.

    <td>{xen:datetime $conversation.start_date}</td>  
    SneakyDave likes this.
  3. SneakyDave

    SneakyDave Well-Known Member

    Woohoo! Thanks AndyB, I was wondering why I couldn't find any references to strfrtime with a search.
  4. SneakyDave

    SneakyDave Well-Known Member

    Now I have the same question about sprintf. Can't seem to find that anywhere, or even to convert a value to 2 decimal places.

    I did find the useful xen:calc function though, so all is not lost.
  5. SneakyDave

    SneakyDave Well-Known Member

    Maybe I can use {xen:number $var, size}, off to see if these are in the xF documentation.

Share This Page