M Marocinoh Member May 20, 2012 #1 Hi, How I can find Server Time without Xenforo, just php code. Example: $_SERVER['REQUEST_TIME'] Xenforo have't servertime default like vBulletin. Attachments Sans titre 1.webp 1.2 KB · Views: 23
Hi, How I can find Server Time without Xenforo, just php code. Example: $_SERVER['REQUEST_TIME'] Xenforo have't servertime default like vBulletin.
Chris D XenForo developer Staff member May 20, 2012 #2 This should help: http://xenforo.com/community/threads/server-time.25469/#post-363653
Chris D XenForo developer Staff member May 20, 2012 #4 I'll create an add on for this and release it shortly.
Jake Bunce Well-known member May 20, 2012 #5 Maybe this? http://xenforo.com/community/threads/xenforo-current-time.7138/#post-101117
Chris D XenForo developer Staff member May 20, 2012 #6 Jake Bunce said: Maybe this? http://xenforo.com/community/threads/xenforo-current-time.7138/#post-101117 Click to expand... That works. How come many requests for this since have overlooked this?
Jake Bunce said: Maybe this? http://xenforo.com/community/threads/xenforo-current-time.7138/#post-101117 Click to expand... That works. How come many requests for this since have overlooked this?
Chris D XenForo developer Staff member May 20, 2012 #8 What Jake posted displays the date and time. If you just want the time only: {xen:time $serverTime, 'absolute'}
What Jake posted displays the date and time. If you just want the time only: {xen:time $serverTime, 'absolute'}
Chris D XenForo developer Staff member May 20, 2012 #9 Marocinoh said: But, not work for me ... :/ (Default Style) Click to expand... Where do you want the time to be displayed?
Marocinoh said: But, not work for me ... :/ (Default Style) Click to expand... Where do you want the time to be displayed?
M Marocinoh Member May 20, 2012 #11 You'r right! Problem it's me. I write in expression phrase adn not a footer template ><'. Sorry :s
M Marocinoh Member May 20, 2012 #13 Sorry ^^' Thank you Yorick and Jake for helping Working fine now Attachments okay.webp 4.9 KB · Views: 20
Jake Bunce Well-known member May 20, 2012 #14 Note that it adjusts the time for the user's time zone: http://xenforo.com/community/account/preferences I don't know of a function to show the server time without applying the time zone of the user.
Note that it adjusts the time for the user's time zone: http://xenforo.com/community/account/preferences I don't know of a function to show the server time without applying the time zone of the user.
Chris D XenForo developer Staff member May 20, 2012 #16 Jake Bunce said: Note that it adjusts the time for the user's time zone: http://xenforo.com/community/account/preferences I don't know of a function to show the server time without applying the time zone of the user. Click to expand... 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; }
Jake Bunce said: Note that it adjusts the time for the user's time zone: http://xenforo.com/community/account/preferences I don't know of a function to show the server time without applying the time zone of the user. Click to expand... 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; }
Jake Bunce Well-known member May 20, 2012 #17 A helper or an added parameter to the existing function would do it.