• 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?

#1
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
 

Jake Bunce

XenForo moderator
Staff member
#2
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.
 

Jake Bunce

XenForo moderator
Staff member
#7
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/
 

James

Well-known member
#8
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
I think the simplest way would be to create a new template helper with some code like:
PHP:
return date('h:i A', $timestamp);
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?