• cdi
  • components
  • contexts
  • converters
  • eventlisteners
  • exceptionhandlers
  • facesviews
  • filters
  • functions
  • managedbeans
  • push
  • resourcehandlers
  • scripts
  • servlets
  • taghandlers
  • utils
  • validators
  • viewhandlers
-
  • now
  • startup

The builtin managed bean #{now} returns you the java.util.Date instance representing the current time.

Demo

Raw Date#toString() value of #{now}: Fri Jan 20 02:52:06 EST 2017

Formatted date using of:formatDate() function: 2017-01-20 02:52:06

Demo source code
<p>
    Raw <code>Date#toString()</code> value of <code>\#{now}</code>: #{now}
</p>
<p>
    Formatted date using <code>of:formatDate()</code> function: #{of:formatDate(now, 'yyyy-MM-dd HH:mm:ss')}
</p>

<h:form>
    <h:commandButton value="Refresh">
        <f:ajax render=":demo" />
    </h:commandButton>
</h:form>