XF 2.1 How to display server time in footer

nevamoen

Member
I am trying to display the current server time in the footer (the actual server time, not adjusted for the timezone of logged-in users).

I added the following block to the PAGE_CONTAINER template:

HTML:
                <div>
                    <div class="p-footer-copyright">Server Time: {{ date('F j, Y, H:i', {$xf.time}) }}
                    </div>
                </div>

Just below the extra_copyright block:

HTML:
                <div>
                    <xf:if contentcheck="true">
                        <div class="p-footer-copyright">
                            <xf:contentcheck>
                                <xf:copyright />
                                {{ phrase('extra_copyright') }}
                            </xf:contentcheck>
                        </div>
                    </xf:if>
                </div>

The server time is displayed correctly for guests and members who are not logged in.
However, the time displayed is adjusted for any logged-in members who have selected a timezone in their preferences.

How can I make this display the unadjusted server time for everyone, including logged-in members?
 
Top Bottom