XF 2.1 Getting the server time.

frm

Well-known member
I'm trying to get the time from the server to display local time.

However, I can't seem to find a conditional searching "time"+"conditional" because both are very common terms.

I want to put the server's time on a page node. Is there a conditional to grab this or would I need a PHP callback?

Edit: Or perhaps, a variable for the time/date to use <xf:set>

Thanks!
 
Doing a suggestion to find variables, I found:
Enter {{ dump(vars()) }} in the ad postion to see what variables are available and in what format.
Which worked perfectly.

The output was this:
Code:
array:6 [▼
  "xf" => array:34 [▼
    "versionId" => 2010070
    "version" => "2.1.0"
    "app" => App {#2 ▶}
    "request" => Request {#234 ▶}
    "uri" => "/pages/test/"
    "fullUri" => ""
    "time" => 1549929145

Solved: It looks like $xf.time can pull the time.

But, my next question is: Is there a global variable page like there is manuals for xf conditionals or do we need to see which variables exist on a page basis? Thank you!
 
Back
Top Bottom