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

ServerTime

Discussion in 'Server Configuration and Hosting' started by Marocinoh, May 20, 2012.

  1. Marocinoh

    Marocinoh Member

    Hi,
    How I can find Server Time without Xenforo, just php code.
    Example: $_SERVER['REQUEST_TIME']

    Xenforo have't servertime default like vBulletin.
     

    Attached Files:

  2. Chris D

    Chris D XenForo Developer Staff Member

  3. Marocinoh

    Marocinoh Member

    I saw but I did not understand :/
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    I'll create an add on for this and release it shortly.
     
    Marocinoh likes this.
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  6. Chris D

    Chris D XenForo Developer Staff Member

  7. Marocinoh

    Marocinoh Member

    But, not work for me ... :/ (Default Style)
     
  8. Chris D

    Chris D XenForo Developer Staff Member

    What Jake posted displays the date and time.

    If you just want the time only:

    {xen:time $serverTime, 'absolute'}
     
  9. Chris D

    Chris D XenForo Developer Staff Member

    Where do you want the time to be displayed?
     
  10. Marocinoh

    Marocinoh Member

    Footer
     

    Attached Files:

  11. Marocinoh

    Marocinoh Member

    You'r right!

    Problem it's me. I write in expression phrase adn not a footer template ><'. Sorry :s
     
  12. Chris D

    Chris D XenForo Developer Staff Member

    Aha, glad you got it working :)
     
  13. Marocinoh

    Marocinoh Member

    Sorry ^^'

    Thank you Yorick and Jake for helping :)

    Working fine now :)
     

    Attached Files:

  14. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  15. Marocinoh

    Marocinoh Member

    It's okay for me.
    This is what I was looking =)
     
  16. Chris D

    Chris D XenForo Developer Staff Member

    Slightly off topic now,

    But would a helper like this work? To display the server time in the server's own timezone?

    PHP:
            public static function helperServerTime()
    {
                    
    $date date('h:i a'time());
    return 
    $date;
    }  
     
  17. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    A helper or an added parameter to the existing function would do it.
     

Share This Page