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

Displaying XenForo Date & Time

#1
Hello. I'm trying to display the current date and time in a theme.

What I originally did was just make a PHP file:

PHP:
  public static function getHtml() {
        $today = date("l , F j - g:i a");
       
        //Sunday , August 31 - 8:09 am
        return $today;
  }
And then using a <xen:callback> block.

I realized after that this was bad because it didn't take account the member's different timezones, so I'm going to assume this will just display the server time, which I don't want.

I see there is this

Code:
<xen:date time="$datetime" />
But it doesn't work when I try to put it into a header file. I'm trying to wrap the user's current time inside a <span>

Thank you