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

XF 1.1 How Do i add Server time?

Discussion in 'XenForo Questions and Support' started by JMPRockFm, Nov 23, 2011.

  1. JMPRockFm

    JMPRockFm Member

    Hello.

    How Would i add Server Time and it will tell you the time of the Server in the uk. what would be the code for that thanks.
    For Minecraft
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    This template code will output the full date and time, but it uses the time zone of the current user:

    Code:
    {xen:datetime $serverTime, 'absolute'}
    
    I don't see any option to display the server time without an offset. This may require an addon.
     
  3. JMPRockFm

    JMPRockFm Member

    Where do i put it
     
  4. Floris

    Floris Guest

    In a template.
     
  5. JMPRockFm

    JMPRockFm Member

    And i want it to Do so it says what the time in the server like uk time
     
  6. JMPRockFm

    JMPRockFm Member

    Like this Screen shot 2011-12-17 at 14.05.59.png
     
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I just looked again but my previous answer still holds. The server time is available as {$serverTime} in the templates, but it's a timestamp. To convert it to a readable time requires using a date function (like xen:datetime from my previous post), but that converts it to the user's time zone. I can't find any date function or option to convert the date without applying the user's time zone. An addon is required. You can post a request here:

    http://xenforo.com/community/forums/add-on-requests.35/
     
  8. James

    James Well-Known Member

    I think the simplest way would be to create a new template helper with some code like:
    PHP:
    return date('h:i A'$timestamp);
     
  9. JMPRockFm

    JMPRockFm Member

    and where do i put this in do i make an new temp?


    and do u know how to get You'r own Make sinks like minecraft? and how to change them?
     
  10. James

    James Well-Known Member

Share This Page